Skip to content

Commit de9ede9

Browse files
authored
Merge pull request #203 from php-http/patch-global
Moved TEST_COMMAND to global section
2 parents 7206951 + 8bc901f commit de9ede9

18 files changed

+65
-33
lines changed

.travis.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ php:
1111
- 5.6
1212
- 7.0
1313
- 7.1
14+
- 7.2
1415

1516
env:
16-
- TEST_COMMAND="composer test"
17+
global:
18+
- TEST_COMMAND="composer test"
1719

1820
branches:
1921
except:
@@ -24,7 +26,7 @@ matrix:
2426
include:
2527
- php: 5.5
2628
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" COVERAGE=true TEST_COMMAND="composer test-ci"
27-
- php: 7.1
29+
- php: 7.2
2830
env: DEPENDENCIES=dev
2931
- php: hhvm
3032
dist: trusty
@@ -35,6 +37,7 @@ matrix:
3537
before_install:
3638
- if [ "$SYMFONY_VERSION" != "" ]; then composer require "symfony/symfony:${SYMFONY_VERSION}" --no-update; fi;
3739
- if [ "$DEPENDENCIES" = "dev" ]; then perl -pi -e 's/^}$/,"minimum-stability":"dev"}/' composer.json; fi;
40+
- if [ $COVERAGE != true ]; then phpenv config-rm xdebug.ini; fi;
3841

3942
install:
4043
- travis_retry composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction

DependencyInjection/Configuration.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,15 +470,19 @@ private function createAuthenticationPluginNode()
470470
switch ($config['type']) {
471471
case 'basic':
472472
$this->validateAuthenticationType(['username', 'password'], $config, 'basic');
473+
473474
break;
474475
case 'bearer':
475476
$this->validateAuthenticationType(['token'], $config, 'bearer');
477+
476478
break;
477479
case 'service':
478480
$this->validateAuthenticationType(['service'], $config, 'service');
481+
479482
break;
480483
case 'wsse':
481484
$this->validateAuthenticationType(['username', 'password'], $config, 'wsse');
485+
482486
break;
483487
}
484488

DependencyInjection/HttplugExtension.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,8 @@ private function configureClient(ContainerBuilder $container, $clientName, array
274274

275275
$plugins = [];
276276
foreach ($arguments['plugins'] as $plugin) {
277-
list($pluginName, $pluginConfig) = each($plugin);
277+
$pluginName = key($plugin);
278+
$pluginConfig = current($plugin);
278279
if ('reference' === $pluginName) {
279280
$plugins[] = $pluginConfig['id'];
280281
} elseif ('authentication' === $pluginName) {

Tests/Functional/ProfilingTest.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@
1515
use Http\Message\Formatter\CurlCommandFormatter;
1616
use Http\Message\Formatter\FullHttpMessageFormatter;
1717
use Http\Mock\Client;
18+
use PHPUnit\Framework\TestCase;
1819
use Psr\Http\Message\RequestInterface;
1920
use Symfony\Component\Cache\Adapter\ArrayAdapter;
2021
use Symfony\Component\Stopwatch\Stopwatch;
2122

22-
class ProfilingTest extends \PHPUnit_Framework_TestCase
23+
class ProfilingTest extends TestCase
2324
{
2425
/**
2526
* @var Collector
@@ -63,14 +64,15 @@ public function testProfilingWithCachePlugin()
6364
$this->assertEquals('example.com', $stack->getRequestHost());
6465
}
6566

67+
/**
68+
* @expectedException \Exception
69+
*/
6670
public function testProfilingWhenPluginThrowException()
6771
{
6872
$client = $this->createClient([
6973
new ExceptionThrowerPlugin(),
7074
]);
7175

72-
$this->setExpectedException(\Exception::class);
73-
7476
try {
7577
$client->sendRequest(new Request('GET', 'https://example.com'));
7678
} finally {

Tests/Unit/ClientFactory/BuzzFactoryTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
use Http\Adapter\Buzz\Client;
66
use Http\HttplugBundle\ClientFactory\BuzzFactory;
77
use Http\Message\MessageFactory;
8+
use PHPUnit\Framework\TestCase;
89

910
/**
1011
* @author Tobias Nyholm <[email protected]>
1112
*/
12-
class BuzzFactoryTest extends \PHPUnit_Framework_TestCase
13+
class BuzzFactoryTest extends TestCase
1314
{
1415
public function testCreateClient()
1516
{

Tests/Unit/ClientFactory/CurlFactoryTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
use Http\Client\Curl\Client;
77
use Http\Message\MessageFactory;
88
use Http\Message\StreamFactory;
9+
use PHPUnit\Framework\TestCase;
910

1011
/**
1112
* @author Tobias Nyholm <[email protected]>
1213
*/
13-
class CurlFactoryTest extends \PHPUnit_Framework_TestCase
14+
class CurlFactoryTest extends TestCase
1415
{
1516
public function testCreateClient()
1617
{

Tests/Unit/ClientFactory/Guzzle6FactoryTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44

55
use Http\HttplugBundle\ClientFactory\Guzzle6Factory;
66
use Http\Adapter\Guzzle6\Client;
7+
use PHPUnit\Framework\TestCase;
78

89
/**
910
* @author Tobias Nyholm <[email protected]>
1011
*/
11-
class Guzzle6FactoryTest extends \PHPUnit_Framework_TestCase
12+
class Guzzle6FactoryTest extends TestCase
1213
{
1314
public function testCreateClient()
1415
{

Tests/Unit/ClientFactory/ReactFactoryTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
use Http\Adapter\React\Client;
66
use Http\HttplugBundle\ClientFactory\ReactFactory;
77
use Http\Message\MessageFactory;
8+
use PHPUnit\Framework\TestCase;
89

910
/**
1011
* @author Tobias Nyholm <[email protected]>
1112
*/
12-
class ReactFactoryTest extends \PHPUnit_Framework_TestCase
13+
class ReactFactoryTest extends TestCase
1314
{
1415
public function testCreateClient()
1516
{

Tests/Unit/ClientFactory/SocketFactoryTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
use Http\Client\Socket\Client;
66
use Http\HttplugBundle\ClientFactory\SocketFactory;
77
use Http\Message\MessageFactory;
8+
use PHPUnit\Framework\TestCase;
89

910
/**
1011
* @author Tobias Nyholm <[email protected]>
1112
*/
12-
class SocketFactoryTest extends \PHPUnit_Framework_TestCase
13+
class SocketFactoryTest extends TestCase
1314
{
1415
public function testCreateClient()
1516
{

Tests/Unit/Collector/CollectorTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44

55
use Http\HttplugBundle\Collector\Collector;
66
use Http\HttplugBundle\Collector\Stack;
7+
use PHPUnit\Framework\TestCase;
78

8-
class CollectorTest extends \PHPUnit_Framework_TestCase
9+
class CollectorTest extends TestCase
910
{
1011
public function testCollectClientNames()
1112
{

0 commit comments

Comments
 (0)