From 325fe6b141746274114a222a6292bd5e62541970 Mon Sep 17 00:00:00 2001 From: Meritoo Date: Tue, 31 Oct 2017 20:28:55 +0100 Subject: [PATCH] Support PHP 5.5.9+ --- .docker/config/Dockerfile | 2 +- composer.json | 13 ++++++++----- tests/Exception/Base/UnknownTypeExceptionTest.php | 2 +- tests/Utilities/DateTest.php | 2 +- tests/Utilities/MiscellaneousTest.php | 6 ++++-- tests/Utilities/ReflectionTest.php | 12 ++++++------ 6 files changed, 21 insertions(+), 16 deletions(-) diff --git a/.docker/config/Dockerfile b/.docker/config/Dockerfile index cb2d05c..13802c4 100644 --- a/.docker/config/Dockerfile +++ b/.docker/config/Dockerfile @@ -1,4 +1,4 @@ -FROM php:5.6-cli +FROM php:5.5-cli # # Tools & libraries diff --git a/composer.json b/composer.json index 3af08b8..9363600 100644 --- a/composer.json +++ b/composer.json @@ -11,18 +11,18 @@ } ], "require": { - "php": ">=5.6.0", + "php": ">=5.5.9", "doctrine/orm": "^2.5", "gedmo/doctrine-extensions": "^2.4", "symfony/http-foundation": "^3.3" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.7", + "friendsofphp/php-cs-fixer": "^2.2", "pdepend/pdepend": "^2.5", - "phploc/phploc": "^4.0", + "phploc/phploc": "^2.1", "phpmd/phpmd": "^2.6", - "phpunit/phpunit": "^5.7", - "sebastian/phpcpd": "^3.0", + "phpunit/phpunit": "^4.8", + "sebastian/phpcpd": "^2.0", "squizlabs/php_codesniffer": "^2.9" }, "autoload": { @@ -34,5 +34,8 @@ "psr-4": { "Meritoo\\Common\\Test\\": "tests/" } + }, + "config": { + "sort-packages": true } } diff --git a/tests/Exception/Base/UnknownTypeExceptionTest.php b/tests/Exception/Base/UnknownTypeExceptionTest.php index a273299..78b8120 100644 --- a/tests/Exception/Base/UnknownTypeExceptionTest.php +++ b/tests/Exception/Base/UnknownTypeExceptionTest.php @@ -33,7 +33,7 @@ class UnknownTypeExceptionTest extends BaseTestCase public function testTheException() { - $this->expectException(UnknownTestTypeException::class); + $this->setExpectedException(UnknownTestTypeException::class); self::assertEmpty((new TestService())->getTranslatedType('test_3')); } } diff --git a/tests/Utilities/DateTest.php b/tests/Utilities/DateTest.php index 97d468b..f750520 100644 --- a/tests/Utilities/DateTest.php +++ b/tests/Utilities/DateTest.php @@ -223,7 +223,7 @@ class DateTest extends BaseTestCase */ public function testGetDayOfWeekIncorrectValues($year, $month, $day) { - $this->expectException(UnknownDatePartTypeException::class); + $this->setExpectedException(UnknownDatePartTypeException::class); self::assertEmpty(Date::getDayOfWeek($year, $month, $day)); } diff --git a/tests/Utilities/MiscellaneousTest.php b/tests/Utilities/MiscellaneousTest.php index ffe7479..90cb155 100644 --- a/tests/Utilities/MiscellaneousTest.php +++ b/tests/Utilities/MiscellaneousTest.php @@ -663,7 +663,8 @@ class MiscellaneousTest extends BaseTestCase public function testGetInvertedColorWithIncorrectLength() { - $this->expectException(IncorrectColorHexLengthException::class); + $this->setExpectedException(IncorrectColorHexLengthException::class); + Miscellaneous::getInvertedColor(null); Miscellaneous::getInvertedColor(''); Miscellaneous::getInvertedColor(1); @@ -676,7 +677,8 @@ class MiscellaneousTest extends BaseTestCase public function testGetInvertedColorWithInvalidValue() { - $this->expectException(InvalidColorHexValueException::class); + $this->setExpectedException(InvalidColorHexValueException::class); + Miscellaneous::getInvertedColor('0011zz'); Miscellaneous::getInvertedColor('001#zz'); Miscellaneous::getInvertedColor('001!zz'); diff --git a/tests/Utilities/ReflectionTest.php b/tests/Utilities/ReflectionTest.php index 195319b..9907779 100644 --- a/tests/Utilities/ReflectionTest.php +++ b/tests/Utilities/ReflectionTest.php @@ -122,7 +122,7 @@ class ReflectionTest extends BaseTestCase */ public function testGetChildClassesInvalidClass($invalidClass) { - $this->expectException(CannotResolveClassNameException::class); + $this->setExpectedException(CannotResolveClassNameException::class); self::assertNull(Reflection::getChildClasses($invalidClass)); self::assertNull(Reflection::getChildClasses(123)); @@ -130,7 +130,7 @@ class ReflectionTest extends BaseTestCase public function testGetChildClassesNotExistingClass() { - $this->expectException(CannotResolveClassNameException::class); + $this->setExpectedException(CannotResolveClassNameException::class); self::assertEquals('', Reflection::getChildClasses('xyz')); } @@ -161,13 +161,13 @@ class ReflectionTest extends BaseTestCase public function testGetOneChildClassWithMissingChildClasses() { - $this->expectException(MissingChildClassesException::class); + $this->setExpectedException(MissingChildClassesException::class); self::assertEquals('LoremIpsum', Reflection::getOneChildClass(C::class)); } public function testGetOneChildClassWithTooManyChildClasses() { - $this->expectException(TooManyChildClassesException::class); + $this->setExpectedException(TooManyChildClassesException::class); self::assertEquals(B::class, Reflection::getOneChildClass(A::class)); self::assertEquals(C::class, Reflection::getOneChildClass(A::class)); @@ -195,7 +195,7 @@ class ReflectionTest extends BaseTestCase */ public function testUsesTraitInvalidClass($class, $trait) { - $this->expectException(CannotResolveClassNameException::class); + $this->setExpectedException(CannotResolveClassNameException::class); self::assertNull(Reflection::usesTrait($class, $trait)); } @@ -205,7 +205,7 @@ class ReflectionTest extends BaseTestCase */ public function testUsesTraitInvalidTrait($trait) { - $this->expectException(CannotResolveClassNameException::class); + $this->setExpectedException(CannotResolveClassNameException::class); self::assertNull(Reflection::usesTrait(DateTime::class, $trait)); }