adding test for find

This commit is contained in:
Trismegiste 2013-07-08 04:35:20 +02:00
parent 51fe7d477f
commit c3a433f0c6

View File

@ -58,4 +58,18 @@ class UserMapperTest extends \PHPUnit_Framework_TestCase
$this->mapper->save($user);
}
/**
* @dataProvider getExistingUser
*/
public function testRestoreOne(User $stored)
{
$this->dbal->expects($this->once())
->method('find')
->with(1)
->will($this->returnValue(new \ArrayIterator(array($stored))));
$user = $this->mapper->findById(1);
echo "Hello " . $user->getUsername() . ". Your email is " . $user->getEmail();
}
}