本文整理汇总了PHP中UnitTester::seeInRepository方法的典型用法代码示例。如果您正苦于以下问题:PHP UnitTester::seeInRepository方法的具体用法?PHP UnitTester::seeInRepository怎么用?PHP UnitTester::seeInRepository使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnitTester
的用法示例。
在下文中一共展示了UnitTester::seeInRepository方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testUserNameCanBeChanged
public function testUserNameCanBeChanged()
{
$date_1 = new DateTime('2000-01-01');
$date_2 = new DateTime('2011-01-01');
// create a user from framework, user will be deleted after the test
$user = $this->tester->haveInRepository('unBundle\\Entity\\Users', ['displayname' => 'Miles', 'username' => 'miles', 'email' => 'u.nitsche@gmail.com', 'algorithm' => 1, 'password' => 'Uasdfasdfasdfw23', 'salt' => 'asdfsadf234', 'avatar' => 1, 'verified' => 1, 'created' => $date_1, 'updated' => $date_2, 'roles' => 1]);
// get entity manager by accessing module
$em = $this->getModule('Doctrine2')->em;
// get real user
$user = $em->find('unBundle\\Entity\\Users', $user);
$user->setUsername('bill');
$user->setDisplayName('Haha');
$em->persist($user);
$em->flush();
$this->assertEquals('bill', $user->getUserName());
// verify data was saved using framework methods
$this->tester->seeInRepository('unBundle\\Entity\\Users', ['username' => 'bill']);
$this->tester->dontSeeInRepository('unBundle\\Entity\\Users', ['username' => 'miles']);
}