Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add tests for BasicAuthListener

  • Loading branch information...
commit 4cee0eb25020ef351ca87d527f2aeed3bd54df06 1 parent fb1d2a2
@rybakit rybakit authored
Showing with 20 additions and 0 deletions.
  1. +20 −0 test/Buzz/Test/Listener/BasicAuthListenerTest.php
View
20 test/Buzz/Test/Listener/BasicAuthListenerTest.php
@@ -0,0 +1,20 @@
+<?php
+
+namespace Buzz\Test\Listener;
+
+use Buzz\Listener\BasicAuthListener;
+use Buzz\Message;
+
+class BasicAuthListenerTest extends \PHPUnit_Framework_TestCase
+{
+ public function testBasicAuthHeader()
+ {
+ $request = new Message\Request();
+ $this->assertEmpty($request->getHeader('Authorization'));
+
+ $listener = new BasicAuthListener('foo', 'bar');
+ $listener->preSend($request);
+
+ $this->assertEquals('Basic '.base64_encode('foo:bar'), $request->getHeader('Authorization'));
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.