tests/Unit/Controllers/UrlControllerTest.php
/**
     * The user_id column in the table of Url must be filled in with the value
     * of the authenticated user id.
     *
     * @test
     * @group u-controller
     */
The user_id column in the table of Url must be filled in with the value
of the authenticated user id.

@test
@group u-controller
The user_id column in the table of Url must be filled in with the value of the authenticated user id . @test @group u - controller
public function shortenUrl_user_id_2()
    {
        $user = $this->admin();
        $longUrl = 'https://laravel.com';
        $this->loginAsAdmin();
        $this->post(route('createshortlink'), [
            'long_url' => $longUrl,
        ]);
        $url = Url::whereLongUrl($longUrl)->first();
        $this->assertSame($user->id, $url->user_id);
    }
public function shortenUrl_user_id_2 ( ) { $ user = $ this -> admin ( ) ; $ longUrl = 'https://laravel.com' ; $ this -> loginAsAdmin ( ) ; $ this -> post ( route ( 'createshortlink' ) , [ 'long_url' => $ longUrl , ] ) ; $ url = Url :: whereLongUrl ( $ longUrl ) -> first ( ) ; $ this -> assertSame ( $ user -> id , $ url -> user_id ) ; }
The user_id column in the table of Url must be filled in with the value
 of the authenticated user id.
The user_id column in the table of Url must be filled in with the value of the authenticated user id .