Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
AnonymTest | n/a |
0 / 0 |
|
100.00% |
12 / 12 |
12 | n/a |
0 / 0 |
||
setUp | |
100.00% |
1 / 1 |
1 | n/a |
0 / 0 |
||||
tearDown | |
100.00% |
1 / 1 |
1 | n/a |
0 / 0 |
||||
testSetObjectName | |
100.00% |
1 / 1 |
1 | n/a |
0 / 0 |
||||
testRemoteToIdentity | |
100.00% |
1 / 1 |
1 | n/a |
0 / 0 |
||||
testGetUserLevel | |
100.00% |
1 / 1 |
1 | n/a |
0 / 0 |
||||
testGetUserID | |
100.00% |
1 / 1 |
1 | n/a |
0 / 0 |
||||
testGetUserLogin | |
100.00% |
1 / 1 |
1 | n/a |
0 / 0 |
||||
testIsLogged | |
100.00% |
1 / 1 |
1 | n/a |
0 / 0 |
||||
testGetSettingValue | |
100.00% |
1 / 1 |
1 | n/a |
0 / 0 |
||||
testGetUserEmail | |
100.00% |
1 / 1 |
1 | n/a |
0 / 0 |
||||
testGetPermission | |
100.00% |
1 / 1 |
1 | n/a |
0 / 0 |
||||
testLogout | |
100.00% |
1 / 1 |
1 | n/a |
0 / 0 |
<?php | |
namespace Test\Ease; | |
use Ease\Anonym; | |
/** | |
* Generated by PHPUnit_SkeletonGenerator on 2016-01-17 at 23:58:38. | |
*/ | |
class AnonymTest extends BrickTest | |
{ | |
/** | |
* @var Anonym | |
*/ | |
protected $object; | |
/** | |
* Sets up the fixture, for example, opens a network connection. | |
* This method is called before a test is executed. | |
*/ | |
protected function setUp() | |
{ | |
$this->object = new Anonym(); | |
} | |
/** | |
* Tears down the fixture, for example, closes a network connection. | |
* This method is called after a test is executed. | |
*/ | |
protected function tearDown() | |
{ | |
} | |
/** | |
* @covers Ease\Anonym::setObjectName | |
*/ | |
public function testSetObjectName() | |
{ | |
$this->assertEquals(get_class($this->object), | |
$this->object->setObjectName()); | |
$this->assertEquals('Test', $this->object->setObjectName('Test')); | |
$_SERVER['REMOTE_ADDR'] = '127.0.0.1'; | |
$this->assertEquals('Ease\Anonym@127.0.0.1', | |
$this->object->setObjectName()); | |
$_SERVER['REMOTE_USER'] = 'tester'; | |
$this->assertEquals('Ease\Anonym@127.0.0.1 [tester]', | |
$this->object->setObjectName()); | |
} | |
/** | |
* @covers Ease\Anonym::remoteToIdentity | |
*/ | |
public function testRemoteToIdentity() | |
{ | |
$_SERVER['REMOTE_ADDR'] = '127.0.0.1'; | |
$this->assertEquals('127.0.0.1', $this->object->remoteToIdentity()); | |
$_SERVER['REMOTE_USER'] = 'tester'; | |
$this->assertEquals('127.0.0.1 [tester]', | |
$this->object->remoteToIdentity()); | |
} | |
/** | |
* @covers Ease\Anonym::getUserLevel | |
*/ | |
public function testGetUserLevel() | |
{ | |
$this->assertEquals(-1, $this->object->getUserLevel()); | |
} | |
/** | |
* @covers Ease\Anonym::getUserID | |
*/ | |
public function testGetUserID() | |
{ | |
$this->assertNull($this->object->getUserID()); | |
} | |
/** | |
* @covers Ease\Anonym::getUserLogin | |
*/ | |
public function testGetUserLogin() | |
{ | |
$this->assertNull($this->object->getUserLogin()); | |
} | |
/** | |
* @covers Ease\Anonym::isLogged | |
*/ | |
public function testIsLogged() | |
{ | |
$this->assertFalse($this->object->isLogged()); | |
} | |
/** | |
* @covers Ease\Anonym::getSettingValue | |
*/ | |
public function testGetSettingValue() | |
{ | |
$this->assertNull($this->object->getSettingValue('test')); | |
} | |
/** | |
* @covers Ease\Anonym::getUserEmail | |
*/ | |
public function testGetUserEmail() | |
{ | |
$this->assertNull($this->object->getUserEmail()); | |
} | |
/** | |
* @covers Ease\Anonym::getPermission | |
*/ | |
public function testGetPermission() | |
{ | |
$this->assertNull($this->object->getPermission()); | |
} | |
/** | |
* @covers Ease\Anonym::logout | |
*/ | |
public function testLogout() | |
{ | |
$this->assertTrue($this->object->logout()); | |
} | |
} |