[Classloader] Refactored ApcUniversalClassLoader to use setUp() to detect APC
This commit is contained in:
parent
1f3a968ef2
commit
29802faef4
@ -16,7 +16,7 @@ use Symfony\Component\ClassLoader\ApcUniversalClassLoader;
|
||||
class ApcUniversalClassLoaderTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
protected function skipIfAPCExtensionIsNotLoadedOrEnabled()
|
||||
protected function setUp()
|
||||
{
|
||||
if (!extension_loaded('apc')) {
|
||||
$this->markTestSkipped('The apc extension is not available.');
|
||||
@ -29,8 +29,6 @@ class ApcUniversalClassLoaderTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function testConstructor()
|
||||
{
|
||||
$this->skipIfAPCExtensionIsNotLoadedOrEnabled();
|
||||
|
||||
$loader = new ApcUniversalClassLoader('test.prefix.');
|
||||
$loader->registerNamespace('Namespaced', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
|
||||
|
||||
@ -42,8 +40,6 @@ class ApcUniversalClassLoaderTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testLoadClass($className, $testClassName, $message)
|
||||
{
|
||||
$this->skipIfAPCExtensionIsNotLoadedOrEnabled();
|
||||
|
||||
$loader = new ApcUniversalClassLoader('test.prefix.');
|
||||
$loader->registerNamespace('Namespaced', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
|
||||
$loader->registerPrefix('Pearlike_', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
|
||||
@ -66,8 +62,6 @@ class ApcUniversalClassLoaderTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testLoadClassFromFallback($className, $testClassName, $message)
|
||||
{
|
||||
$this->skipIfAPCExtensionIsNotLoadedOrEnabled();
|
||||
|
||||
$loader = new ApcUniversalClassLoader('test.prefix.');
|
||||
$loader->registerNamespace('Namespaced', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
|
||||
$loader->registerPrefix('Pearlike_', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
|
||||
@ -92,8 +86,6 @@ class ApcUniversalClassLoaderTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testLoadClassNamespaceCollision($namespaces, $className, $message)
|
||||
{
|
||||
$this->skipIfAPCExtensionIsNotLoadedOrEnabled();
|
||||
|
||||
$loader = new ApcUniversalClassLoader('test.prefix.');
|
||||
$loader->registerNamespaces($namespaces);
|
||||
|
||||
@ -144,8 +136,6 @@ class ApcUniversalClassLoaderTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testLoadClassPrefixCollision($prefixes, $className, $message)
|
||||
{
|
||||
$this->skipIfAPCExtensionIsNotLoadedOrEnabled();
|
||||
|
||||
$loader = new ApcUniversalClassLoader('test.prefix.');
|
||||
$loader->registerPrefixes($prefixes);
|
||||
|
||||
|
Reference in New Issue
Block a user