Commit 459ff926 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Ajout tests pour meilleure couverture.

parent 7e1b0aea
......@@ -48,14 +48,66 @@ class PeopleAdapterTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(0, $entity->getState());
}
/**
* @expectedException \BadMethodCallException
*/
public function testSettingStateThrowsException()
{
$this->entity->setState('whatever');
}
public function testGetDisplayNameReturnsString()
{
$this->assertInternalType('string', $this->entity->getDisplayName());
$this->assertNotEmpty($this->entity->getDisplayName());
}
/**
* @expectedException \BadMethodCallException
*/
public function testSettingDisplayNameThrowsException()
{
$this->entity->setDisplayName('whatever');
}
public function testGetEmailReturnsString()
{
$this->assertInternalType('string', $this->entity->getEmail());
$this->assertNotEmpty($this->entity->getEmail());
}
/**
* @expectedException \BadMethodCallException
*/
public function testSettingEmailThrowsException()
{
$this->entity->setEmail('whatever');
}
public function testGetUsernameReturnsSupannAliasLogin()
{
$this->assertEquals(PeopleTestAsset::$data1['supannaliaslogin'], $this->entity->getUsername());
}
/**
* @expectedException \BadMethodCallException
*/
public function testSettingUsernameThrowsException()
{
$this->entity->setUsername('whatever');
}
public function testGetPasswordReturnsNull()
{
$entity = new PeopleAdapter(PeopleTestAsset::$data1);
$this->assertNull($entity->getPassword());
}
/**
* @expectedException \BadMethodCallException
*/
public function testSettingPasswordThrowsException()
{
$this->entity->setPassword('whatever');
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment