public function test_get_credentials() { $parser = new BasicAuthParser(); $headers = new HttpHeaders(); $parser->setToken($headers, $parser->createToken('foo', 'bar')); $this->assertEquals(['foo', 'bar'], $parser->getCredentials($headers)); }
public function test_get_token() { $request = new HttpRequest(); $auth = new HttpBasicAuth($request); $parser = new BasicAuthParser(); $parser->setToken($request->getHeaders(), 'foo'); $this->assertEquals('foo', $auth->getToken()); }