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

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