Skip to content

Commit

Permalink
Merge pull request #1953 from carusogabriel/phpunit
Browse files Browse the repository at this point in the history
Use PHPUnit\Framework\TestCase instead of PHPUnit_Framework_TestCase
  • Loading branch information
sagikazarmark committed Feb 5, 2018
2 parents 287bc97 + 36e89c8 commit 8b8df00
Show file tree
Hide file tree
Showing 27 changed files with 53 additions and 27 deletions.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -19,7 +19,7 @@
},
"require-dev": {
"ext-curl": "*",
"phpunit/phpunit": "^4.0 || ^5.0",
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4",
"psr/log": "^1.0"
},
"autoload": {
Expand Down
1 change: 1 addition & 0 deletions phpunit.xml.dist
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="./tests/bootstrap.php"
backupGlobals="true"
colors="true">
<testsuites>
<testsuite>
Expand Down
3 changes: 2 additions & 1 deletion tests/ClientTest.php
Expand Up @@ -11,8 +11,9 @@
use GuzzleHttp\Psr7\Response;
use GuzzleHttp\Psr7\Uri;
use Psr\Http\Message\ResponseInterface;
use PHPUnit\Framework\TestCase;

class ClientTest extends \PHPUnit_Framework_TestCase
class ClientTest extends TestCase
{
public function testUsesDefaultHandler()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Cookie/CookieJarTest.php
Expand Up @@ -5,11 +5,12 @@
use GuzzleHttp\Cookie\SetCookie;
use GuzzleHttp\Psr7\Request;
use GuzzleHttp\Psr7\Response;
use PHPUnit\Framework\TestCase;

/**
* @covers GuzzleHttp\Cookie\CookieJar
*/
class CookieJarTest extends \PHPUnit_Framework_TestCase
class CookieJarTest extends TestCase
{
/** @var CookieJar */
private $jar;
Expand Down
3 changes: 2 additions & 1 deletion tests/Cookie/FileCookieJarTest.php
Expand Up @@ -3,11 +3,12 @@

use GuzzleHttp\Cookie\FileCookieJar;
use GuzzleHttp\Cookie\SetCookie;
use PHPUnit\Framework\TestCase;

/**
* @covers GuzzleHttp\Cookie\FileCookieJar
*/
class FileCookieJarTest extends \PHPUnit_Framework_TestCase
class FileCookieJarTest extends TestCase
{
private $file;

Expand Down
3 changes: 2 additions & 1 deletion tests/Cookie/SessionCookieJarTest.php
Expand Up @@ -3,11 +3,12 @@

use GuzzleHttp\Cookie\SessionCookieJar;
use GuzzleHttp\Cookie\SetCookie;
use PHPUnit\Framework\TestCase;

/**
* @covers GuzzleHttp\Cookie\SessionCookieJar
*/
class SessionCookieJarTest extends \PHPUnit_Framework_TestCase
class SessionCookieJarTest extends TestCase
{
private $sessionVar;

Expand Down
3 changes: 2 additions & 1 deletion tests/Cookie/SetCookieTest.php
Expand Up @@ -2,11 +2,12 @@
namespace GuzzleHttp\Tests\CookieJar;

use GuzzleHttp\Cookie\SetCookie;
use PHPUnit\Framework\TestCase;

/**
* @covers GuzzleHttp\Cookie\SetCookie
*/
class SetCookieTest extends \PHPUnit_Framework_TestCase
class SetCookieTest extends TestCase
{
public function testInitializesDefaultValues()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Exception/ConnectExceptionTest.php
Expand Up @@ -3,11 +3,12 @@

use GuzzleHttp\Exception\ConnectException;
use GuzzleHttp\Psr7\Request;
use PHPUnit\Framework\TestCase;

/**
* @covers GuzzleHttp\Exception\ConnectException
*/
class ConnectExceptionTest extends \PHPUnit_Framework_TestCase
class ConnectExceptionTest extends TestCase
{
public function testHasNoResponse()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Exception/RequestExceptionTest.php
Expand Up @@ -4,11 +4,12 @@
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Psr7\Request;
use GuzzleHttp\Psr7\Response;
use PHPUnit\Framework\TestCase;

/**
* @covers GuzzleHttp\Exception\RequestException
*/
class RequestExceptionTest extends \PHPUnit_Framework_TestCase
class RequestExceptionTest extends TestCase
{
public function testHasRequestAndResponse()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Exception/SeekExceptionTest.php
Expand Up @@ -3,8 +3,9 @@

use GuzzleHttp\Exception\SeekException;
use GuzzleHttp\Psr7;
use PHPUnit\Framework\TestCase;

class SeekExceptionTest extends \PHPUnit_Framework_TestCase
class SeekExceptionTest extends TestCase
{
public function testHasStream()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Handler/CurlFactoryTest.php
Expand Up @@ -8,11 +8,12 @@
use GuzzleHttp\Psr7;
use GuzzleHttp\TransferStats;
use Psr\Http\Message\ResponseInterface;
use PHPUnit\Framework\TestCase;

/**
* @covers \GuzzleHttp\Handler\CurlFactory
*/
class CurlFactoryTest extends \PHPUnit_Framework_TestCase
class CurlFactoryTest extends TestCase
{
public static function setUpBeforeClass()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Handler/CurlHandlerTest.php
Expand Up @@ -7,11 +7,12 @@
use GuzzleHttp\Psr7\Request;
use GuzzleHttp\Psr7\Response;
use GuzzleHttp\Tests\Server;
use PHPUnit\Framework\TestCase;

/**
* @covers \GuzzleHttp\Handler\CurlHandler
*/
class CurlHandlerTest extends \PHPUnit_Framework_TestCase
class CurlHandlerTest extends TestCase
{
protected function getHandler($options = [])
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Handler/CurlMultiHandlerTest.php
Expand Up @@ -5,8 +5,9 @@
use GuzzleHttp\Psr7\Request;
use GuzzleHttp\Psr7\Response;
use GuzzleHttp\Tests\Server;
use PHPUnit\Framework\TestCase;

class CurlMultiHandlerTest extends \PHPUnit_Framework_TestCase
class CurlMultiHandlerTest extends TestCase
{
public function testSendsRequest()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Handler/EasyHandleTest.php
Expand Up @@ -3,11 +3,12 @@

use GuzzleHttp\Handler\EasyHandle;
use GuzzleHttp\Psr7;
use PHPUnit\Framework\TestCase;

/**
* @covers \GuzzleHttp\Handler\EasyHandle
*/
class EasyHandleTest extends \PHPUnit_Framework_TestCase
class EasyHandleTest extends TestCase
{
/**
* @expectedException \BadMethodCallException
Expand Down
3 changes: 2 additions & 1 deletion tests/Handler/MockHandlerTest.php
Expand Up @@ -6,11 +6,12 @@
use GuzzleHttp\Psr7\Request;
use GuzzleHttp\Psr7\Response;
use GuzzleHttp\TransferStats;
use PHPUnit\Framework\TestCase;

/**
* @covers \GuzzleHttp\Handler\MockHandler
*/
class MockHandlerTest extends \PHPUnit_Framework_TestCase
class MockHandlerTest extends TestCase
{
public function testReturnsMockResponse()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Handler/ProxyTest.php
Expand Up @@ -5,11 +5,12 @@
use GuzzleHttp\Handler\Proxy;
use GuzzleHttp\Psr7\Request;
use GuzzleHttp\RequestOptions;
use PHPUnit\Framework\TestCase;

/**
* @covers \GuzzleHttp\Handler\Proxy
*/
class ProxyTest extends \PHPUnit_Framework_TestCase
class ProxyTest extends TestCase
{
public function testSendsToNonSync()
{
Expand Down
5 changes: 3 additions & 2 deletions tests/Handler/StreamHandlerTest.php
Expand Up @@ -11,11 +11,12 @@
use GuzzleHttp\Tests\Server;
use GuzzleHttp\TransferStats;
use Psr\Http\Message\ResponseInterface;
use PHPUnit\Framework\TestCase;

/**
* @covers \GuzzleHttp\Handler\StreamHandler
*/
class StreamHandlerTest extends \PHPUnit_Framework_TestCase
class StreamHandlerTest extends TestCase
{
private function queueRes()
{
Expand Down Expand Up @@ -49,7 +50,7 @@ public function testReturnsResponseForSuccessfulRequest()
}

/**
* @expectedException \GuzzleHttp\Exception\ConnectException
* @expectedException \GuzzleHttp\Exception\RequestException
*/
public function testAddsErrorToResponse()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/HandlerStackTest.php
Expand Up @@ -6,8 +6,9 @@
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Psr7\Request;
use GuzzleHttp\Psr7\Response;
use PHPUnit\Framework\TestCase;

class HandlerStackTest extends \PHPUnit_Framework_TestCase
class HandlerStackTest extends TestCase
{
public function testSetsHandlerInCtor()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/MessageFormatterTest.php
Expand Up @@ -6,11 +6,12 @@
use GuzzleHttp\Psr7\Request;
use GuzzleHttp\Psr7\Response;
use GuzzleHttp\MessageFormatter;
use PHPUnit\Framework\TestCase;

/**
* @covers GuzzleHttp\MessageFormatter
*/
class MessageFormatterTest extends \PHPUnit_Framework_TestCase
class MessageFormatterTest extends TestCase
{
public function testCreatesWithClfByDefault()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/MiddlewareTest.php
Expand Up @@ -16,8 +16,9 @@
use Psr\Http\Message\ResponseInterface;
use Psr\Log\LoggerInterface;
use Psr\Log\LoggerTrait;
use PHPUnit\Framework\TestCase;

class MiddlewareTest extends \PHPUnit_Framework_TestCase
class MiddlewareTest extends TestCase
{
public function testAddsCookiesToRequests()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/PoolTest.php
Expand Up @@ -10,8 +10,9 @@
use GuzzleHttp\Psr7\Response;
use GuzzleHttp\Promise\Promise;
use Psr\Http\Message\RequestInterface;
use PHPUnit\Framework\TestCase;

class PoolTest extends \PHPUnit_Framework_TestCase
class PoolTest extends TestCase
{
/**
* @expectedException \InvalidArgumentException
Expand Down
3 changes: 2 additions & 1 deletion tests/PrepareBodyMiddlewareTest.php
Expand Up @@ -10,8 +10,9 @@
use GuzzleHttp\Psr7\Request;
use GuzzleHttp\Psr7\Response;
use Psr\Http\Message\RequestInterface;
use PHPUnit\Framework\TestCase;

class PrepareBodyMiddlewareTest extends \PHPUnit_Framework_TestCase
class PrepareBodyMiddlewareTest extends TestCase
{

public function methodProvider()
Expand Down
3 changes: 2 additions & 1 deletion tests/RedirectMiddlewareTest.php
Expand Up @@ -9,11 +9,12 @@
use GuzzleHttp\Psr7\Response;
use GuzzleHttp\RedirectMiddleware;
use Psr\Http\Message\RequestInterface;
use PHPUnit\Framework\TestCase;

/**
* @covers GuzzleHttp\RedirectMiddleware
*/
class RedirectMiddlewareTest extends \PHPUnit_Framework_TestCase
class RedirectMiddlewareTest extends TestCase
{
public function testIgnoresNonRedirects()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/RetryMiddlewareTest.php
Expand Up @@ -8,8 +8,9 @@
use GuzzleHttp\Psr7\Request;
use GuzzleHttp\Psr7\Response;
use GuzzleHttp\RetryMiddleware;
use PHPUnit\Framework\TestCase;

class RetryMiddlewareTest extends \PHPUnit_Framework_TestCase
class RetryMiddlewareTest extends TestCase
{
public function testRetriesWhenDeciderReturnsTrue()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/TransferStatsTest.php
Expand Up @@ -3,8 +3,9 @@

use GuzzleHttp\TransferStats;
use GuzzleHttp\Psr7;
use PHPUnit\Framework\TestCase;

class TransferStatsTest extends \PHPUnit_Framework_TestCase
class TransferStatsTest extends TestCase
{
public function testHasData()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/UriTemplateTest.php
Expand Up @@ -2,11 +2,12 @@
namespace GuzzleHttp\Tests;

use GuzzleHttp\UriTemplate;
use PHPUnit\Framework\TestCase;

/**
* @covers GuzzleHttp\UriTemplate
*/
class UriTemplateTest extends \PHPUnit_Framework_TestCase
class UriTemplateTest extends TestCase
{
/**
* @return array
Expand Down
3 changes: 2 additions & 1 deletion tests/functionsTest.php
Expand Up @@ -2,8 +2,9 @@
namespace GuzzleHttp\Test;

use GuzzleHttp;
use PHPUnit\Framework\TestCase;

class FunctionsTest extends \PHPUnit_Framework_TestCase
class FunctionsTest extends TestCase
{
public function testExpandsTemplate()
{
Expand Down

0 comments on commit 8b8df00

Please sign in to comment.