oauth2-client/tests/Bootstrap.php

44 lines
840 B
PHP
Raw Normal View History

2013-02-26 16:02:34 +04:00
<?php
2014-04-24 10:13:25 +04:00
namespace LeagueTests\OAuth2\Client;
error_reporting(E_ALL | E_STRICT);
chdir(__DIR__);
/**
* Test bootstrap, for setting up autoloading
*
* @subpackage UnitTest
*/
class Bootstrap
{
protected static $serviceManager;
public static function init()
{
static::initAutoloader();
}
protected static function initAutoloader()
{
$vendorPath = static::findParentPath('vendor');
$loader = include $vendorPath . '/autoload.php';
}
protected static function findParentPath($path)
{
$dir = __DIR__;
$previousDir = '.';
while (!is_dir($dir . '/' . $path)) {
$dir = dirname($dir);
if ($previousDir === $dir) return false;
$previousDir = $dir;
}
return $dir . '/' . $path;
}
2013-11-18 06:45:28 +04:00
}
2014-04-24 10:13:25 +04:00
Bootstrap::init();