Tests > fix "This test did not perform any assertions" bug > make compatible with PHPUnit 8.0 (and PHP 7.2+)

This commit is contained in:
Meritoo
2019-04-02 10:40:51 +02:00
parent 8a27cd94ef
commit 95a81ab322

View File

@@ -76,23 +76,21 @@ class ReflectionTest extends BaseTestCase
])); ]));
} }
public function testGetClassNameDuplicatedName() /**
{ * A case when namespace of class contains name of class (name of class is duplicated, occurs twice)
/*
* Class with namespace containing name of class (duplicated string)
*/ */
if (class_exists('Symfony\Bundle\SecurityBundle\SecurityBundle')) { public function testGetClassWhileNamespaceContainsClassName()
{
self::assertEquals( self::assertEquals(
'Symfony\Bundle\SecurityBundle\SecurityBundle', 'Meritoo\Common\Collection\Collection',
Reflection::getClassName('Symfony\Bundle\SecurityBundle\SecurityBundle') Reflection::getClassName(Collection::class)
); );
self::assertEquals( self::assertEquals(
'SecurityBundle', 'Collection',
Reflection::getClassName('Symfony\Bundle\SecurityBundle\SecurityBundle', true) Reflection::getClassName(Collection::class, true)
); );
} }
}
public function testGetClassNamespaceNotExistingClass() public function testGetClassNamespaceNotExistingClass()
{ {
@@ -116,18 +114,16 @@ class ReflectionTest extends BaseTestCase
])); ]));
} }
public function testGetClassNamespaceDuplicatedName() /**
{ * A case when namespace of class contains name of class (name of class is duplicated, occurs twice)
/*
* Class with namespace containing name of class (duplicated string)
*/ */
if (class_exists('Symfony\Bundle\SecurityBundle\SecurityBundle')) { public function testGetClassNamespaceWhileNamespaceContainsClassName()
{
self::assertEquals( self::assertEquals(
'Symfony\Bundle\SecurityBundle', 'Meritoo\Common\Collection',
Reflection::getClassNamespace('Symfony\Bundle\SecurityBundle\SecurityBundle') Reflection::getClassNamespace(Collection::class)
); );
} }
}
/** /**
* @param mixed $invalidClass Empty value, e.g. "" * @param mixed $invalidClass Empty value, e.g. ""