mirror of
https://github.com/wiosna-dev/common-library.git
synced 2026-03-12 09:31:51 +01:00
Infection (Mutation Testing Framework) > fix bugs while running (generate proper code coverage, bugs while running tests randomly)
This commit is contained in:
@@ -176,14 +176,22 @@ class ReflectionTest extends BaseTestCase
|
||||
|
||||
public function testGetOneChildClassWithTooManyChildClasses()
|
||||
{
|
||||
$this->expectException(TooManyChildClassesException::class);
|
||||
// Required to get all classes by get_declared_classes() function and avoid failure:
|
||||
//
|
||||
// Failed asserting that exception of type "Meritoo\Common\Exception\Reflection\TooManyChildClassesException"
|
||||
// is thrown
|
||||
new C();
|
||||
|
||||
self::assertEquals(B::class, Reflection::getOneChildClass(A::class));
|
||||
self::assertEquals(C::class, Reflection::getOneChildClass(A::class));
|
||||
$this->expectException(TooManyChildClassesException::class);
|
||||
Reflection::getOneChildClass(A::class);
|
||||
}
|
||||
|
||||
public function testGetOneChildClass()
|
||||
{
|
||||
// Required to get all classes by get_declared_classes() function and avoid throw of
|
||||
// Meritoo\Common\Exception\Reflection\MissingChildClassesException exception
|
||||
new C();
|
||||
|
||||
self::assertEquals(C::class, Reflection::getOneChildClass(B::class));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user