本文整理汇总了PHP中Autoloader::removeAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Autoloader::removeAll方法的具体用法?PHP Autoloader::removeAll怎么用?PHP Autoloader::removeAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Autoloader
的用法示例。
在下文中一共展示了Autoloader::removeAll方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testAutoload
/**
* Asserts that the class $class is loadable after
* registration of its class definition $path
*
* @param String $class The class which is autoloaded
* @param String $path The class defintion
*
* @dataProvider provideTestAutoload
* @return void
* @see InternalAutoloader::registerClass()
*/
public function testAutoload($class, $path)
{
$autoloaderTestHelper = new AutoloaderTestHelper($this);
Autoloader::removeAll();
$autoloaderTestHelper->assertNotLoadable($class);
InternalAutoloader::getInstance()->registerClass($class, $path);
$autoloaderTestHelper->assertLoadable($class);
}
示例2: setUp
/**
* Removes all Autoloaders from the stack and initializes
* the AutoloaderTestHelper $_autoloaderTestHelper.
*
* @see $_autoloaderTestHelper
* @return void
*/
public function setUp()
{
$this->_autoloaderTestHelper = new AutoloaderTestHelper($this);
Autoloader::removeAll();
}
示例3: testSeveralRequiredAutoloaders
/**
* Asserts that including the file Autoloader.php will register each time an
* instance of Autoloader with the correct class path
*
* @see Autoloader.php
* @return void
*/
public function testSeveralRequiredAutoloaders()
{
$autoloaders = Autoloader::getRegisteredAutoloaders();
Autoloader::removeAll();
$autoloaderPath = dirname(__FILE__) . "/../Autoloader.php";
$classA = $this->_autoloaderTestHelper->makeClass("A", "a");
$classA2 = $this->_autoloaderTestHelper->makeClass("A2", "a");
$requireA = $this->_autoloaderTestHelper->makeClass("requireA", "a", "<?php require '{$autoloaderPath}' ?>");
$classB = $this->_autoloaderTestHelper->makeClass("B", "b");
$requireB = $this->_autoloaderTestHelper->makeClass("requireB", "b", "<?php require '{$autoloaderPath}' ?>");
$this->_autoloaderTestHelper->assertNotLoadable($classA);
$this->_autoloaderTestHelper->assertNotLoadable($classA2);
include AutoloaderTestHelper::getClassDirectory() . DIRECTORY_SEPARATOR . "a" . DIRECTORY_SEPARATOR . "{$requireA}.test.php";
$this->_autoloaderTestHelper->assertLoadable($classA);
$this->_autoloaderTestHelper->assertNotLoadable($classB);
include AutoloaderTestHelper::getClassDirectory() . DIRECTORY_SEPARATOR . "b" . DIRECTORY_SEPARATOR . "{$requireB}.test.php";
$this->_autoloaderTestHelper->assertLoadable($classA);
$this->_autoloaderTestHelper->assertLoadable($classA2);
$this->_autoloaderTestHelper->assertLoadable($classB);
Autoloader::removeAll();
foreach ($autoloaders as $autoloader) {
$autoloader->register();
}
}