mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-02-24 09:42:24 +01:00
adding test for find
This commit is contained in:
parent
51fe7d477f
commit
c3a433f0c6
@ -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();
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user