时间:2021-07-01 10:21:17 帮助过:26人阅读
示例代码:
prophet->prophesize('App\Security\Hasher'); $user = new App\Entity\User($hasher->reveal()); $hasher->generateHash($user, 'qwerty')->willReturn('hashed_pass'); $user->setPassword('qwerty'); $this->assertEquals('hashed_pass', $user->getPassword()); } protected function setup() { $this->prophet = new \Prophecy\Prophet; } protected function tearDown() { $this->prophet->checkPredictions(); }}
项目主页:http://www.open-open.com/lib/view/home/1437393986490