Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Unit test for self:: to static:: Http\Client update
Browse files Browse the repository at this point in the history
  • Loading branch information
tklever authored and Ocramius committed Jul 28, 2014
1 parent 34d795d commit 650e12d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Zend\Http\Request;
use Zend\Http\Response;
use Zend\Http\Client\Adapter\Test;
use ZendTest\Http\TestAsset\ExtendedClient;


class ClientTest extends \PHPUnit_Framework_TestCase
Expand Down Expand Up @@ -374,4 +375,15 @@ public function testPrepareHeadersCreateRightHttpField()
$this->assertArrayNotHasKey('content-length', $headers);
$this->assertArrayHasKey('Content-Length', $headers);
}

/**
* Test for pull request 6301
* Previous functionality would have thrown an exception
* This test serves to verify that exception is not thrown
*/
public function testCanSpecifyCustomAuthMethodsInExtendingClasses()
{
$client = new ExtendedClient();
$client->setAuth('username', 'password', ExtendedClient::AUTH_CUSTOM);
}
}
10 changes: 10 additions & 0 deletions test/TestAsset/ExtendedClient.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace ZendTest\Http\TestAsset;

use Zend\Http\Client;

class ExtendedClient extends Client
{
const AUTH_CUSTOM = 'custom';
}

0 comments on commit 650e12d

Please sign in to comment.