You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
110 lines
2.4 KiB
110 lines
2.4 KiB
<?php
|
|
/**
|
|
* Generated by PHPUnit_SkeletonGenerator on 2013-02-17 at 00:36:52.
|
|
*/
|
|
// exiting because generates fatal error:
|
|
// Fatal error: Cannot instantiate abstract class Access in /var/lib/jenkins/jobs/chamilo-lms-1.9/workspace/tests/phpunit/classes/AccessTest.class.php on line 18
|
|
//exit;
|
|
return;
|
|
class AccessTest extends PHPUnit_Framework_TestCase
|
|
{
|
|
/**
|
|
* @var Access
|
|
*/
|
|
protected $object;
|
|
|
|
/**
|
|
* Sets up the fixture, for example, opens a network connection.
|
|
* This method is called before a test is executed.
|
|
*/
|
|
protected function setUp()
|
|
{
|
|
require_once dirname(__FILE__).'/../../../main/inc/global.inc.php';
|
|
$this->object = new Access;
|
|
}
|
|
|
|
/**
|
|
* Tears down the fixture, for example, closes a network connection.
|
|
* This method is called after a test is executed.
|
|
*/
|
|
protected function tearDown()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* Generated from @assert () !== null.
|
|
*
|
|
* @covers Access::all
|
|
*/
|
|
public function testAll()
|
|
{
|
|
$this->assertNotSame(
|
|
null,
|
|
Access::all()
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Generated from @assert () === null.
|
|
*
|
|
* @covers Access::forbidden
|
|
*/
|
|
public function testForbidden()
|
|
{
|
|
$this->assertSame(
|
|
null,
|
|
Access::forbidden()
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Generated from @assert () === false.
|
|
*
|
|
* @covers Access::is_token_valid
|
|
*/
|
|
public function testIs_token_valid()
|
|
{
|
|
$this->assertSame(
|
|
false,
|
|
$this->object->is_token_valid()
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Generated from @assert () !== null.
|
|
*
|
|
* @covers Access::get_session_token
|
|
*/
|
|
public function testGet_session_token()
|
|
{
|
|
$this->assertNotSame(
|
|
null,
|
|
$this->object->get_session_token()
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Generated from @assert () === false.
|
|
*
|
|
* @covers Access::authorize
|
|
*/
|
|
public function testAuthorize()
|
|
{
|
|
$this->assertSame(
|
|
false,
|
|
$this->object->authorize()
|
|
);
|
|
}
|
|
|
|
/**
|
|
* @covers Access::get_token
|
|
* @todo Implement testGet_token().
|
|
*/
|
|
public function testGet_token()
|
|
{
|
|
// Remove the following lines when you implement this test.
|
|
$this->markTestIncomplete(
|
|
'This test has not been implemented yet.'
|
|
);
|
|
}
|
|
}
|
|
|