mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-03 21:47:25 +02:00
adding test for find
This commit is contained in:
@@ -58,4 +58,18 @@ class UserMapperTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->mapper->save($user);
|
$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();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
Reference in New Issue
Block a user