本文整理汇总了PHP中UnitTester::seeEventTriggered方法的典型用法代码示例。如果您正苦于以下问题:PHP UnitTester::seeEventTriggered方法的具体用法?PHP UnitTester::seeEventTriggered怎么用?PHP UnitTester::seeEventTriggered使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnitTester
的用法示例。
在下文中一共展示了UnitTester::seeEventTriggered方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testUserCreateCommand_userCanBeCreated
public function testUserCreateCommand_userCanBeCreated()
{
$adapter = app('App\\Adapters\\MockAdapter');
$adapter->setAuthState(null, null, false);
$command = new UserCreateCommand('slice-beans', 'matt.gray@retrofuzz.com', 'password');
$adapter->dispatchCommand($command);
$this->tester->seeRecord('users', ['email' => 'matt.gray@retrofuzz.com', 'username' => 'slice-beans']);
$this->tester->seeEventTriggered(\App\Events\UserCreatedEvent::class);
}
示例2: testUserUpdateCommand_userCanUpdateOtherUser
public function testUserUpdateCommand_userCanUpdateOtherUser()
{
$user = factory(App\Models\User::class)->create(['email' => 'temp@temp.com']);
$adapter = app('App\\Adapters\\MockAdapter');
$adapter->setAuthState(999, $user->id, false);
$command = new UserUpdateCommand('matt.gray@retrofuzz.com');
$adapter->dispatchCommand($command);
$this->tester->seeRecord('users', ['id' => $user->id, 'email' => 'matt.gray@retrofuzz.com']);
$this->tester->seeEventTriggered(\App\Events\UserUpdatedEvent::class);
}