<?php namespace mageekguy\atoum\vw; use mageekguy\atoum; atoum\autoloader::get()->addNamespaceAlias('atoum\\vw', __NAMESPACE__)->addDirectory(__NAMESPACE__, __DIR__ . DIRECTORY_SEPARATOR . 'classes');
<?php namespace jdecool\atoum\symfonyDependencyInjection; use mageekguy\atoum; atoum\autoloader::get()->addNamespaceAlias('atoum\\symfonyDependencyInjection', __NAMESPACE__)->addDirectory(__NAMESPACE__, __DIR__ . DIRECTORY_SEPARATOR . 'classes');
<?php namespace mageekguy\atoum\ruler; use mageekguy\atoum; $vendorDirectory = __DIR__ . '/vendor'; if (is_dir($vendorDirectory) === false) { $vendorDirectory = __DIR__ . '/../..'; } $hoa = array('hoa/core' => 'Core.php', 'hoa/consistency' => 'Prelude.php', 'hoa/protocol' => 'Wrapper.php', 'hoa/compiler' => null, 'hoa/event' => null, 'hoa/exception' => null, 'hoa/file' => null, 'hoa/iterator' => null, 'hoa/math' => null, 'hoa/regex' => null, 'hoa/ruler' => null, 'hoa/stream' => null, 'hoa/string' => null, 'hoa/ustring' => null, 'hoa/visitor' => null, 'hoa/zformat' => null); foreach ($hoa as $library => $file) { $parts = explode('/', $library); $parts = array_map('ucfirst', $parts); $namespace = implode('\\', $parts); $root = $vendorDirectory . DIRECTORY_SEPARATOR . $library; if (is_dir($root)) { if (null === $file) { atoum\autoloader::get()->addDirectory($namespace, $root); } else { if (file_exists($root . DIRECTORY_SEPARATOR . $file)) { atoum\autoloader::get()->addDirectory($namespace, $root); require_once $root . DIRECTORY_SEPARATOR . $file; } } } } atoum\autoloader::get()->addNamespaceAlias('atoum\\ruler', __NAMESPACE__)->addDirectory(__NAMESPACE__, __DIR__ . '/classes');
<?php namespace mageekguy\atoum\reports; use mageekguy\atoum; $directories = [__DIR__ . DIRECTORY_SEPARATOR . 'vendor', __DIR__ . DIRECTORY_SEPARATOR . '../..']; $vendorDir = null; foreach ($directories as $directory) { if (is_dir($directory)) { $vendorDir = $directory; break; } } if ($vendorDir === null) { throw new \Exception('Unable to find the vendor directory'); } $filesystemDir = $vendorDir . DIRECTORY_SEPARATOR . 'symfony' . DIRECTORY_SEPARATOR . 'filesystem'; $filesystemSuffix = 'Symfony' . DIRECTORY_SEPARATOR . 'Component' . DIRECTORY_SEPARATOR . 'Filesystem'; if (is_dir($filesystemDir . DIRECTORY_SEPARATOR . $filesystemSuffix) === true) { $filesystemDir = $filesystemDir . DIRECTORY_SEPARATOR . $filesystemSuffix; } atoum\autoloader::get()->addNamespaceAlias('atoum\\reports', __NAMESPACE__)->addDirectory(__NAMESPACE__, __DIR__ . DIRECTORY_SEPARATOR . 'classes')->addDirectory('Symfony\\Component\\Filesystem', $filesystemDir); require_once $vendorDir . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . 'twig' . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'Twig' . DIRECTORY_SEPARATOR . 'Autoloader.php'; $twigAutoloader = new \Twig_Autoloader(); $twigAutoloader->register();
<?php namespace mageekguy\atoum\reports\tests; use mageekguy\atoum; require_once __DIR__ . '/../autoloader.php'; atoum\autoloader::get()->addDirectory(__NAMESPACE__, __DIR__);
<?php namespace Sohoa\Framework\Tests\Unit; use mageekguy\atoum; require_once __DIR__ . '/../../vendor/autoload.php'; atoum\autoloader::get()->addDirectory(__NAMESPACE__ . '\\Asserters', __DIR__ . '/Asserters');
<?php namespace mageekguy\atoum\phpunit; use mageekguy\atoum; atoum\autoloader::get()->addNamespaceAlias('atoum\\phpunit', __NAMESPACE__)->addClassAlias('atoum\\phpunit', __NAMESPACE__ . '\\test')->addClassAlias('mageekguy\\atoum\\phpunit', __NAMESPACE__ . '\\test')->addDirectory(__NAMESPACE__, __DIR__ . DIRECTORY_SEPARATOR . 'classes'); $isPhpUnit = isset($_SERVER['argv'][0]) && preg_match('/phpunit$/', $_SERVER['argv'][0]); if ($isPhpUnit === false) { $aliases = array('PHPUnit_Framework_TestCase' => 'mageekguy\\atoum\\phpunit\\test', 'PHPUnit_Framework_Constraint' => 'mageekguy\\atoum\\phpunit\\constraint', 'PHPUnit_Framework_AssertionFailedError' => 'mageekguy\\atoum\\asserter\\exception', 'PHPUnit_Framework_Exception' => 'mageekguy\\atoum\\exceptions\\runtime', 'PHPUnit_Framework_ExpectationFailedException' => 'mageekguy\\atoum\\phpunit\\constraint\\exception'); foreach ($aliases as $phpunitClass => $atoumClass) { if (class_exists($phpunitClass, false)) { throw new atoum\exceptions\logic(sprintf('Class %s already exists', $phpunitClass)); } atoum\autoloader::get()->addClassAlias($phpunitClass, $atoumClass); } }
<?php namespace mageekguy\atoum\tests\units; require_once __DIR__ . '/../../scripts/runner.php'; \mageekguy\atoum\autoloader::get()->addDirectory(__NAMESPACE__, __DIR__ . '/classes')->addDirectory(__NAMESPACE__ . '\\asserters', __DIR__ . '/asserters');
<?php namespace mageekguy\atoum\tests\functionals; use mageekguy\atoum; if (defined('atoum\\scripts\\runner') === false) { define('atoum\\scripts\\runner', __FILE__); } require_once __DIR__ . '/../../scripts/runner.php'; atoum\autoloader::get()->addDirectory(__NAMESPACE__ . '\\test', __DIR__ . '/test');
<?php namespace mageekguy\atoum\phpunit\tests; use mageekguy\atoum; require_once __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'autoloader.php'; atoum\autoloader::get()->addDirectory(__NAMESPACE__, __DIR__)->addDirectory('mageekguy\\atoum\\autoloop', __DIR__ . DIRECTORY_SEPARATOR . '../vendor/atoum/autoloop-extension/classes')->addDirectory('Lurker', __DIR__ . DIRECTORY_SEPARATOR . '../vendor/henrikbjorn/lurker/src/Lurker')->addDirectory('Symfony\\Component\\EventDispatcher', __DIR__ . DIRECTORY_SEPARATOR . '../vendor/symfony/event-dispatcher')->addDirectory('Symfony\\Component\\Config', __DIR__ . DIRECTORY_SEPARATOR . '../vendor/symfony/config');