Support PHP 5.5.9+

This commit is contained in:
Meritoo
2017-10-31 20:28:55 +01:00
parent a1c26b3812
commit 325fe6b141
6 changed files with 21 additions and 16 deletions

View File

@@ -1,4 +1,4 @@
FROM php:5.6-cli
FROM php:5.5-cli
#
# Tools & libraries

View File

@@ -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
}
}

View File

@@ -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'));
}
}

View File

@@ -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));
}

View File

@@ -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');

View File

@@ -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));
}