setAuthBasic example

yield ['user:password', 'user', 'password'];
        yield ['user:password', 'user:password'];
        yield ['user', 'user'];
        yield ['user:0', 'user', '0'];
    }

    /** * @dataProvider provideSetAuthBasic */
    public function testSetAuthBasic(string $expected, string $user, string $password = '')
    {
        $this->assertSame($expected(new HttpOptions())->setAuthBasic($user$password)->toArray()['auth_basic']);
    }

    public function testSetAuthBearer()
    {
        $this->assertSame('foobar', (new HttpOptions())->setAuthBearer('foobar')->toArray()['auth_bearer']);
    }
}
Home | Imprint | This part of the site doesn't use cookies.