App\Tests\Auth\OAuthServerTest::itValidatesWrongCredentials PHP Method

itValidatesWrongCredentials() public method

If an authorized client makes a request with wrong user credentials it should return 401
    public function itValidatesWrongCredentials()
    {
        DB::table('oauth_clients')->insert(['id' => '12345', 'secret' => '12345', 'name' => 'Testing Env', 'created_at' => Carbon::now()->format('Y-m-d H:i:s'), 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')]);
        $this->post('/api/oauth/authorize', ['grant_type' => 'password', 'client_id' => "12345", 'client_secret' => "12345", 'username' => "[email protected]", 'password' => "testing"])->seeStatusCode(401)->seeJson(['errors' => ['status' => '401', 'code' => 'InvalidCredentials', 'title' => 'Invalid Credentials', 'detail' => 'The information for the login is invalid']]);
    }