tests/Unit/Controllers/UrlControllerTest.php
/**
     * The keyword column in the table of Url must be filled in with the value
     * given by User. The is_custom column must be filled with 1 / true.
     *
     * @test
     * @group u-controller
     */
The keyword column in the table of Url must be filled in with the value
given by User. The is_custom column must be filled with 1 / true.

@test
@group u-controller
The keyword column in the table of Url must be filled in with the value given by User . The is_custom column must be filled with 1 / true . @test @group u - controller
public function shortenUrl_is_custom()
    {
        config(['urlhub.hash_length' => 6]);
        $longUrl = 'https://laravel.com';
        $customKey = 'foo_bar';
        $this->post(route('createshortlink'), [
            'long_url'   => $longUrl,
            'custom_key' => $customKey,
        ]);
        $url = Url::whereLongUrl($longUrl)->first();
        $this->assertSame($customKey, $url->keyword);
        $this->assertTrue($url->is_custom);
    }
public function shortenUrl_is_custom ( ) { config ( [ 'urlhub.hash_length' => 6 ] ) ; $ longUrl = 'https://laravel.com' ; $ customKey = 'foo_bar' ; $ this -> post ( route ( 'createshortlink' ) , [ 'long_url' => $ longUrl , 'custom_key' => $ customKey , ] ) ; $ url = Url :: whereLongUrl ( $ longUrl ) -> first ( ) ; $ this -> assertSame ( $ customKey , $ url -> keyword ) ; $ this -> assertTrue ( $ url -> is_custom ) ; }
The keyword column in the table of Url must be filled in with the value
 given by User.
The keyword column in the table of Url must be filled in with the value given by User .