Last active
December 19, 2018 22:16
-
-
Save devmsh/88b307c66a5ba01d4d1d858a5024635b to your computer and use it in GitHub Desktop.
MultipleMobileTest.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class MultipleMobileTest extends TestCase | |
| { | |
| public function test_user_can_add_new_mobile() | |
| { | |
| Event::fake([MobileVerifying::class,MobileVerified::class]); | |
| $user = $this->newVerifiedUser(); | |
| $response = $this->postJson('api/user/mobiles', [ | |
| 'mobile' => '970567940999', | |
| ]); | |
| $response->assertSuccessful(); | |
| $this->assertCount(2, $user->fresh()->mobiles); | |
| \Event::assertDispatched(MobileVerifying::class,function($event){ | |
| $this->assertInstanceOf(UserMobile::class, $event->mobile); | |
| return true; | |
| }); | |
| \Event::assertDispatched(MobileVerified::class); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment