Пример #1
0
 public function test_get_username()
 {
     $request = new HttpRequest();
     $auth = new HttpBasicAuth($request);
     $parser = new BasicAuthParser();
     $parser->setUsername($request->getHeaders(), 'foo');
     $this->assertEquals('foo', $auth->getUsername());
 }
Пример #2
0
 public function test_set_username()
 {
     $parser = new BasicAuthParser();
     $headers = new HttpHeaders();
     $parser->setCredentials($headers, 'foo', 'bar');
     $parser->setUsername($headers, 'yolo');
     $this->assertEquals('yolo', $parser->getUsername($headers));
     $this->assertEquals('bar', $parser->getPassword($headers));
 }