Пример #1
0
 public static function addAutoloadFile($fileName)
 {
     $classes = (include $fileName);
     if (is_array($classes)) {
         self::$classes = array_merge(self::$classes, $classes);
     }
 }
Пример #2
0
 public function testAutoloadExpectingTrue()
 {
     PhpCssLoader::addAutoloadFile(dirname(__FILE__) . '/TestData/LoaderData.php');
     PhpCssLoader::autoload('PhpCssLoaderTestClass');
     $this->assertTrue(class_exists('PhpCssLoaderTestClass', FALSE));
 }
Пример #3
0
<?php

/**
* Load necessary files
*/
require_once 'PHPUnit/Framework.php';
require_once dirname(__FILE__) . '/../../src/PhpCss/Loader.php';
PhpCssLoader::addAutoloadFile(dirname(__FILE__) . '/../../src/PhpCss/Loader/All.php');
spl_autoload_register('PhpCssLoader::autoload');
PHPUnit_Util_Filter::addFileToFilter(__FILE__);
abstract class PhpCssTestCase extends PHPUnit_Framework_TestCase
{
    public static function includePhpCssFile($file)
    {
        include_once dirname(__FILE__) . '/../../src/PhpCss' . $file;
    }
}
Пример #4
0
<?php

/**
 * PhpCss Demo: Setup Include
 */
/* Load PhpCss files */
$PhpCssPath = dirname(__FILE__) . '/../../../src/PhpCss/';
require_once $PhpCssPath . 'Loader.php';
PhpCssLoader::addAutoloadFile($PhpCssPath . '/Loader/Scanner.php');
spl_autoload_register('PhpCssLoader::autoload');