diff --git a/.gitignore b/.gitignore index a491db9..677266f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ vendor composer.lock composer.phar -.php_cs.cache \ No newline at end of file +.php_cs.cache +.phpunit.result.cache \ No newline at end of file diff --git a/composer.json b/composer.json index 43fe011..dbb206d 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ "psr/simple-cache": "1.0.*" }, "require-dev": { - "phpunit/phpunit": "^5.7", + "phpunit/phpunit": "^8.5", "mockery/mockery": "^1.2", "friendsofphp/php-cs-fixer": "^2.15", "jakub-onderka/php-parallel-lint": "^1.0", diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 811e82e..da759e8 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -8,7 +8,6 @@ convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" - syntaxCheck="false" bootstrap="tests/bootstrap.php" > diff --git a/tests/Unit/CacheDecoratorTest.php b/tests/Unit/CacheDecoratorTest.php index cce45c8..b6f00fe 100644 --- a/tests/Unit/CacheDecoratorTest.php +++ b/tests/Unit/CacheDecoratorTest.php @@ -3,16 +3,17 @@ namespace Test\Skautis; use Mockery\MockInterface; +use PHPUnit\Framework\TestCase; use Skautis\User; use Skautis\Wsdl\Decorator\Cache\CacheDecorator; use Skautis\Wsdl\WebServiceInterface; use Symfony\Component\Cache\Adapter\ArrayAdapter; use Symfony\Component\Cache\Psr16Cache; -class CacheDecoratorTest extends \PHPUnit_Framework_TestCase +class CacheDecoratorTest extends TestCase { - protected function tearDown() + protected function tearDown(): void { \Mockery::close(); } diff --git a/tests/Unit/ConfigTest.php b/tests/Unit/ConfigTest.php index 4a04b86..10c7768 100644 --- a/tests/Unit/ConfigTest.php +++ b/tests/Unit/ConfigTest.php @@ -2,9 +2,10 @@ namespace Test\Skautis; +use PHPUnit\Framework\TestCase; use Skautis\Config; -class ConfigTest extends \PHPUnit_Framework_TestCase +class ConfigTest extends TestCase { public function testDefaultConfiguration(): void diff --git a/tests/Unit/HelpersTest.php b/tests/Unit/HelpersTest.php index 2e0d5f2..dc871dc 100644 --- a/tests/Unit/HelpersTest.php +++ b/tests/Unit/HelpersTest.php @@ -2,13 +2,14 @@ namespace Test\Skautis; +use PHPUnit\Framework\TestCase; use Skautis\Helpers; use Skautis\User; -class HelpersTest extends \PHPUnit_Framework_TestCase +class HelpersTest extends TestCase { - protected function tearDown() + protected function tearDown(): void { \Mockery::close(); } diff --git a/tests/Unit/SessionAdapterTest.php b/tests/Unit/SessionAdapterTest.php index 59a510f..382c22e 100644 --- a/tests/Unit/SessionAdapterTest.php +++ b/tests/Unit/SessionAdapterTest.php @@ -2,11 +2,12 @@ namespace Test\Skautis; +use PHPUnit\Framework\TestCase; use Skautis\SessionAdapter\AdapterInterface; use Skautis\SessionAdapter\SessionAdapter; use Skautis\SessionAdapter\FakeAdapter; -class SessionAdapterTest extends \PHPUnit_Framework_TestCase +class SessionAdapterTest extends TestCase { diff --git a/tests/Unit/SkautisQueryTest.php b/tests/Unit/SkautisQueryTest.php index a32f900..60bf8c1 100644 --- a/tests/Unit/SkautisQueryTest.php +++ b/tests/Unit/SkautisQueryTest.php @@ -2,9 +2,10 @@ namespace Test\Skautis; +use PHPUnit\Framework\TestCase; use Skautis\SkautisQuery; -class SkautisQueryTest extends \PHPUnit_Framework_TestCase +class SkautisQueryTest extends TestCase { public function testQuery() { diff --git a/tests/Unit/SkautisTest.php b/tests/Unit/SkautisTest.php index d5ac350..0fd9e35 100644 --- a/tests/Unit/SkautisTest.php +++ b/tests/Unit/SkautisTest.php @@ -2,7 +2,7 @@ namespace Test\Skautis; -use PHPUnit_Framework_TestCase; +use PHPUnit\Framework\TestCase; use Skautis\Config; use Skautis\DynamicPropertiesDisabledException; use Skautis\Skautis; @@ -10,10 +10,10 @@ use Skautis\Wsdl\WebServiceName; use Skautis\Wsdl\WsdlManager; -class SkautisTest extends PHPUnit_Framework_TestCase +class SkautisTest extends TestCase { - protected function tearDown() + protected function tearDown(): void { \Mockery::close(); } @@ -104,6 +104,7 @@ public function testGetRegisterURL(): void { public function testEventSetter(): void { + $this->markTestSkipped(); //@TODO } } diff --git a/tests/Unit/UserTest.php b/tests/Unit/UserTest.php index 22e4519..68b24fd 100644 --- a/tests/Unit/UserTest.php +++ b/tests/Unit/UserTest.php @@ -2,14 +2,15 @@ namespace Test\Skautis; +use PHPUnit\Framework\TestCase; use Skautis\User; use Skautis\Wsdl\WsdlManager; use Skautis\Wsdl\WebService; -class UserTest extends \PHPUnit_Framework_TestCase +class UserTest extends TestCase { - protected function tearDown() + protected function tearDown(): void { \Mockery::close(); } diff --git a/tests/Unit/WebServiceFactoryTest.php b/tests/Unit/WebServiceFactoryTest.php index 0307f7d..cd6575c 100644 --- a/tests/Unit/WebServiceFactoryTest.php +++ b/tests/Unit/WebServiceFactoryTest.php @@ -2,10 +2,11 @@ namespace Test\Skautis; +use PHPUnit\Framework\TestCase; use Skautis\InvalidArgumentException; use Skautis\Wsdl\WebServiceFactory; -class WebServiceFactoryTest extends \PHPUnit_Framework_TestCase +class WebServiceFactoryTest extends TestCase { public function testEmptyWSDL() { diff --git a/tests/Unit/WebServiceNameTest.php b/tests/Unit/WebServiceNameTest.php index 85770bf..931356d 100644 --- a/tests/Unit/WebServiceNameTest.php +++ b/tests/Unit/WebServiceNameTest.php @@ -6,10 +6,10 @@ namespace Test\Skautis; -use PHPUnit_Framework_TestCase; +use PHPUnit\Framework\TestCase; use Skautis\Wsdl\WebServiceName; -class WebServiceNameTest extends PHPUnit_Framework_TestCase +class WebServiceNameTest extends TestCase { public function testIsValid(): void diff --git a/tests/Unit/WebServiceTest.php b/tests/Unit/WebServiceTest.php index 515215c..b863542 100644 --- a/tests/Unit/WebServiceTest.php +++ b/tests/Unit/WebServiceTest.php @@ -2,13 +2,14 @@ namespace Test\Skautis; +use PHPUnit\Framework\TestCase; use Skautis; use Skautis\Wsdl\WebService; use Skautis\Exception as SkautisException; use Skautis\SkautisQuery; use Skautis\Wsdl\WebServiceFactory; -class WebServiceTest extends \PHPUnit_Framework_TestCase +class WebServiceTest extends TestCase { protected $queries = []; @@ -18,7 +19,7 @@ class WebServiceTest extends \PHPUnit_Framework_TestCase */ private $wsFactory; - protected function setUp() + protected function setUp(): void { $this->wsFactory = new WebServiceFactory(); } diff --git a/tests/Unit/WsdlManager/GetWebServiceTest.php b/tests/Unit/WsdlManager/GetWebServiceTest.php index 63be1a3..6b06f43 100644 --- a/tests/Unit/WsdlManager/GetWebServiceTest.php +++ b/tests/Unit/WsdlManager/GetWebServiceTest.php @@ -3,14 +3,14 @@ namespace Test\Skautis; use Mockery; -use PHPUnit_Framework_TestCase; +use PHPUnit\Framework\TestCase; use Skautis\Config; use Skautis\Wsdl\WebServiceFactoryInterface; use Skautis\Wsdl\WebServiceName; use Skautis\Wsdl\WsdlManager; use Skautis\Wsdl\WebServiceInterface; -class GetWebServiceTest extends PHPUnit_Framework_TestCase +class GetWebServiceTest extends TestCase { public function testGetWebService(): void diff --git a/tests/Unit/WsdlManager/IsMaintenanceTest.php b/tests/Unit/WsdlManager/IsMaintenanceTest.php index 7c7e766..f8890e6 100644 --- a/tests/Unit/WsdlManager/IsMaintenanceTest.php +++ b/tests/Unit/WsdlManager/IsMaintenanceTest.php @@ -42,7 +42,7 @@ function get_headers(string $url){ namespace Test\Skautis; use Mockery; -use PHPUnit_Framework_TestCase; +use PHPUnit\Framework\TestCase; use Skautis\Config; use Skautis\Wsdl\MaintenanceErrorException; use Skautis\Wsdl\WebServiceFactoryInterface; @@ -50,7 +50,7 @@ function get_headers(string $url){ use Skautis\Wsdl\WsdlManager; use Skautis\Wsdl\WebServiceInterface; -class IsMaintenanceTest extends PHPUnit_Framework_TestCase +class IsMaintenanceTest extends TestCase { /** @@ -58,7 +58,7 @@ class IsMaintenanceTest extends PHPUnit_Framework_TestCase */ private $manager; - protected function setUp() + protected function setUp(): void { $factory = Mockery::mock(WebServiceFactoryInterface::class); $config = new Config('42');