From e54009917cb2d1bad798e77f4bc8dbb568ed9024 Mon Sep 17 00:00:00 2001 From: Devon Bagley Date: Mon, 2 Apr 2018 15:16:22 -0700 Subject: [PATCH 1/7] phpunit does not seem to be working correctly anymore in php 7+ This commit provides updated thruway/client as well as phpunit --- composer.json | 6 +++--- src/Vinelab/Minion/Client.php | 7 ++++++- tests/UnitTestCase.php | 4 ++-- tests/unit/ClientTest.php | 2 +- tests/unit/DictionaryTest.php | 2 +- tests/unit/MinionTest.php | 2 +- 6 files changed, 14 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index 0f1475d..3668940 100644 --- a/composer.json +++ b/composer.json @@ -11,12 +11,12 @@ ], "require": { "php": ">=5.4.0", - "voryx/thruway": "0.3.*", "illuminate/support": "5.*", - "illuminate/console": "5.*" + "illuminate/console": "5.*", + "thruway/client": "^0.5.3" }, "require-dev": { - "phpunit/phpunit": "4.*", + "phpunit/phpunit": "6.*", "mockery/mockery": "0.9.*", "fabpot/php-cs-fixer": "*", "squizlabs/php_codesniffer": "1.*" diff --git a/src/Vinelab/Minion/Client.php b/src/Vinelab/Minion/Client.php index 95173bb..75c7b54 100644 --- a/src/Vinelab/Minion/Client.php +++ b/src/Vinelab/Minion/Client.php @@ -55,8 +55,13 @@ public function __construct($realm, array $providers) */ public function onSessionStart($session, $transport) { + // Below disabled. Logging is now handled through a static class + // so there is no way that I can see to disable the logging since + // the split from voryx/thruway to thruway/client. getManager is + // also no longer a method on the Client class. // Shush the logs. - $this->getManager()->setQuiet(true); + // $this->getManager()->setQuiet(true); + // Boot up providers $this->bootProviders(); } diff --git a/tests/UnitTestCase.php b/tests/UnitTestCase.php index 8d06319..16ba01f 100644 --- a/tests/UnitTestCase.php +++ b/tests/UnitTestCase.php @@ -1,9 +1,9 @@ */ -class UnitTestCase extends PHPUnit_Framework_TestCase +class UnitTestCase extends PHPUnit\Framework\TestCase { public function test_running() { diff --git a/tests/unit/ClientTest.php b/tests/unit/ClientTest.php index c15fc4b..29d2bbf 100644 --- a/tests/unit/ClientTest.php +++ b/tests/unit/ClientTest.php @@ -371,7 +371,7 @@ protected function getProxyCallbackMock() } } -class ClientTestProviderStub extends PHPUnit_Framework_TestCase +class ClientTestProviderStub extends PHPUnit\Framework\TestCase { public function __construct($client) { diff --git a/tests/unit/DictionaryTest.php b/tests/unit/DictionaryTest.php index 852eb7d..90869d4 100644 --- a/tests/unit/DictionaryTest.php +++ b/tests/unit/DictionaryTest.php @@ -5,7 +5,7 @@ /** * @author Abed Halawi */ -class DictionaryTest extends PHPUnit_Framework_TestCase +class DictionaryTest extends PHPUnit\Framework\TestCase { public function test_initializing_dictionary() { diff --git a/tests/unit/MinionTest.php b/tests/unit/MinionTest.php index 18d24ea..4207dc1 100644 --- a/tests/unit/MinionTest.php +++ b/tests/unit/MinionTest.php @@ -5,7 +5,7 @@ /** * @author Abed Halawi */ -class MinionTest extends PHPUnit_Framework_TestCase +class MinionTest extends PHPUnit\Framework\TestCase { public function setUp() { From ae76839a0086a5cd5b1845faf07fbd3e72e2dd78 Mon Sep 17 00:00:00 2001 From: Devon Bagley Date: Mon, 2 Apr 2018 15:31:04 -0700 Subject: [PATCH 2/7] Update travis rules to test on higher php versions. Roll phpunit back to v5 for php 5.6+ support --- .travis.yml | 5 ++--- composer.json | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index f60bbe0..2cb33b6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,9 @@ language: php php: - - 5.4 - - 5.5 - 5.6 - - hhvm + - 7.0 + - 7.1 before_script: - travis_retry composer self-update diff --git a/composer.json b/composer.json index 3668940..c771c65 100644 --- a/composer.json +++ b/composer.json @@ -10,13 +10,13 @@ } ], "require": { - "php": ">=5.4.0", + "php": ">=5.6.0", "illuminate/support": "5.*", "illuminate/console": "5.*", "thruway/client": "^0.5.3" }, "require-dev": { - "phpunit/phpunit": "6.*", + "phpunit/phpunit": "^5", "mockery/mockery": "0.9.*", "fabpot/php-cs-fixer": "*", "squizlabs/php_codesniffer": "1.*" From 4bf48ebab608e8202e20dde47ca4db70a136474b Mon Sep 17 00:00:00 2001 From: Devon Bagley Date: Fri, 27 Apr 2018 16:18:17 -0700 Subject: [PATCH 3/7] Update versions --- composer.json | 15 ++++++++------- phpunit.xml | 18 ------------------ tests/UnitTestCase.php | 2 +- tests/unit/ClientTest.php | 2 +- tests/unit/DictionaryTest.php | 2 +- tests/unit/MinionTest.php | 2 +- 6 files changed, 12 insertions(+), 29 deletions(-) delete mode 100644 phpunit.xml diff --git a/composer.json b/composer.json index c771c65..259d8cf 100644 --- a/composer.json +++ b/composer.json @@ -10,16 +10,17 @@ } ], "require": { - "php": ">=5.6.0", - "illuminate/support": "5.*", - "illuminate/console": "5.*", - "thruway/client": "^0.5.3" + "php": ">=7.0.1", + "illuminate/support": "^5.5", + "illuminate/console": "^5.5", + "thruway/client": "^0.5.3", + "thruway/pawl-transport": "^0.5.0" }, "require-dev": { - "phpunit/phpunit": "^5", + "phpunit/phpunit": "^6", "mockery/mockery": "0.9.*", - "fabpot/php-cs-fixer": "*", - "squizlabs/php_codesniffer": "1.*" + "squizlabs/php_codesniffer": "^3.2", + "friendsofphp/php-cs-fixer": "^2.11" }, "autoload": { "psr-0": { diff --git a/phpunit.xml b/phpunit.xml deleted file mode 100644 index f69c9fa..0000000 --- a/phpunit.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - ./tests/unit/ - - - diff --git a/tests/UnitTestCase.php b/tests/UnitTestCase.php index 16ba01f..35330e3 100644 --- a/tests/UnitTestCase.php +++ b/tests/UnitTestCase.php @@ -3,7 +3,7 @@ /** * @author Abed Halawi */ -class UnitTestCase extends PHPUnit\Framework\TestCase +class UnitTestCase extends PHPUnit_Framework_TestCase { public function test_running() { diff --git a/tests/unit/ClientTest.php b/tests/unit/ClientTest.php index 29d2bbf..c15fc4b 100644 --- a/tests/unit/ClientTest.php +++ b/tests/unit/ClientTest.php @@ -371,7 +371,7 @@ protected function getProxyCallbackMock() } } -class ClientTestProviderStub extends PHPUnit\Framework\TestCase +class ClientTestProviderStub extends PHPUnit_Framework_TestCase { public function __construct($client) { diff --git a/tests/unit/DictionaryTest.php b/tests/unit/DictionaryTest.php index 90869d4..852eb7d 100644 --- a/tests/unit/DictionaryTest.php +++ b/tests/unit/DictionaryTest.php @@ -5,7 +5,7 @@ /** * @author Abed Halawi */ -class DictionaryTest extends PHPUnit\Framework\TestCase +class DictionaryTest extends PHPUnit_Framework_TestCase { public function test_initializing_dictionary() { diff --git a/tests/unit/MinionTest.php b/tests/unit/MinionTest.php index 4207dc1..18d24ea 100644 --- a/tests/unit/MinionTest.php +++ b/tests/unit/MinionTest.php @@ -5,7 +5,7 @@ /** * @author Abed Halawi */ -class MinionTest extends PHPUnit\Framework\TestCase +class MinionTest extends PHPUnit_Framework_TestCase { public function setUp() { From 28cebcb1582dcc3a9eb08facd46f309fcff02820 Mon Sep 17 00:00:00 2001 From: Devon Bagley Date: Fri, 27 Apr 2018 16:23:24 -0700 Subject: [PATCH 4/7] Update php versions for travis. --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2cb33b6..cdfef54 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ language: php php: - - 5.6 - 7.0 - 7.1 From 6a64e1f132bd35531ce3a9ef5b9ce84ceb22d633 Mon Sep 17 00:00:00 2001 From: Devon Bagley Date: Fri, 27 Apr 2018 16:24:06 -0700 Subject: [PATCH 5/7] Re-add the phpunit configuration file --- phpunit.xml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 phpunit.xml diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..f69c9fa --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,18 @@ + + + + + ./tests/unit/ + + + From 4a5db4469ce647f7dc4a7386994e6dbfec7f0eef Mon Sep 17 00:00:00 2001 From: Devon Bagley Date: Fri, 27 Apr 2018 16:33:38 -0700 Subject: [PATCH 6/7] Update phpunit tests for updated class names --- tests/UnitTestCase.php | 3 ++- tests/unit/ClientTest.php | 2 +- tests/unit/DictionaryTest.php | 2 +- tests/unit/MinionTest.php | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/UnitTestCase.php b/tests/UnitTestCase.php index 35330e3..e1f62e5 100644 --- a/tests/UnitTestCase.php +++ b/tests/UnitTestCase.php @@ -3,10 +3,11 @@ /** * @author Abed Halawi */ -class UnitTestCase extends PHPUnit_Framework_TestCase +class UnitTestCase extends PHPUnit\Framework\TestCase { public function test_running() { + $this->asserttrue(true); } protected function unProtectMethod($name, $class) diff --git a/tests/unit/ClientTest.php b/tests/unit/ClientTest.php index c15fc4b..29d2bbf 100644 --- a/tests/unit/ClientTest.php +++ b/tests/unit/ClientTest.php @@ -371,7 +371,7 @@ protected function getProxyCallbackMock() } } -class ClientTestProviderStub extends PHPUnit_Framework_TestCase +class ClientTestProviderStub extends PHPUnit\Framework\TestCase { public function __construct($client) { diff --git a/tests/unit/DictionaryTest.php b/tests/unit/DictionaryTest.php index 852eb7d..90869d4 100644 --- a/tests/unit/DictionaryTest.php +++ b/tests/unit/DictionaryTest.php @@ -5,7 +5,7 @@ /** * @author Abed Halawi */ -class DictionaryTest extends PHPUnit_Framework_TestCase +class DictionaryTest extends PHPUnit\Framework\TestCase { public function test_initializing_dictionary() { diff --git a/tests/unit/MinionTest.php b/tests/unit/MinionTest.php index 18d24ea..4207dc1 100644 --- a/tests/unit/MinionTest.php +++ b/tests/unit/MinionTest.php @@ -5,7 +5,7 @@ /** * @author Abed Halawi */ -class MinionTest extends PHPUnit_Framework_TestCase +class MinionTest extends PHPUnit\Framework\TestCase { public function setUp() { From 0c26adc886c8915d7e7cf4e082045a2fb7162c80 Mon Sep 17 00:00:00 2001 From: Devon Bagley Date: Fri, 27 Apr 2018 16:44:06 -0700 Subject: [PATCH 7/7] remove require, since phpunit config should include this --- tests/UnitTestCase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/UnitTestCase.php b/tests/UnitTestCase.php index e1f62e5..7366001 100644 --- a/tests/UnitTestCase.php +++ b/tests/UnitTestCase.php @@ -1,5 +1,5 @@ */