Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /** @test */
- public function it_updates_personal_details(){
- $this->withoutMiddleware();
- $this->visit('/account/settings')
- ->post('/account/settings', ["firstname"=>"RingoUpdated", 'lastname'=>"RingyUpdated", "username"=>"ringo", "bio"=>"My Personal Information", "facebook"=>"myFbUsername", "twitter"=>"myTwUsername", ])
- ->seeJson([
- "signup"=>true
- ]);
- }
- public function it_updates_personal_details(){
- Auth::shouldReceive('id')->andReturn(1);
- $this->withoutMiddleware();
- $this->visit('/account/settings')
- ->post('/account/settings', ["firstname"=>"RingoUpdated", 'lastname'=>"RingyUpdated", "username"=>"ringo", "bio"=>"My Personal Information", "facebook"=>"myFbUsername", "twitter"=>"myTwUsername", ])
- ->seeJson([
- "signup"=>true
- ]);
- }
- <?php
- use IlluminateFoundationTestingWithoutMiddleware;
- use IlluminateFoundationTestingDatabaseMigrations;
- use IlluminateFoundationTestingDatabaseTransactions;
- use AppUser; // user model
- class ExampleTest extends TestCase
- {
- public function testApplication()
- {
- $user = User::find(1); // find specific user
- $this->actingAs($user)
- ->visit('/')
- ->see('Hello, '.$user->name);
- }
- }
- $user = factory(AppUser::class)->create();
- $this->actingAs($user)
- ->visit('/')
- ->see('Hello, '.$user->name);
- public function loginWithFakeUser()
- {
- $user = new User([
- 'id' => 1,
- 'name' => 'yish'
- ]);
- $this->be($user);
- }
Add Comment
Please, Sign In to add comment