summaryrefslogtreecommitdiff
path: root/vendor/lusitanian/oauth/tests/bootstrap.php
blob: 193b857a9d6263c983031a4d1ac69f69ce14a3aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
/**
 * Bootstrap the tests
 *
 * PHP version 5.3
 *
 * @category   OAuthTest
 * @author     Pieter Hordijk <info@pieterhordijk.com>
 * @author     David Desberg  <david@daviddesberg.com>
 * @copyright  Copyright (c) 2012 Pieter Hordijk
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 */
namespace OAuthTest;

/**
 * Setting up the default timezone. because well... PHP sucks
 */
date_default_timezone_set('Europe/Amsterdam');

/**
 * Simple SPL autoloader for the OAuthTest mocks
 *
 * @param string $class The class name to load
 *
 * @return void
 */
spl_autoload_register(function ($class) {
    $nslen = strlen(__NAMESPACE__);
    if (substr($class, 0, $nslen) !== __NAMESPACE__) {
        return;
    }
    $path = substr(str_replace('\\', '/', $class), $nslen);
    $path = __DIR__ . $path . '.php';
    if (file_exists($path)) {
        require $path;
    }
});

/**
 * Fire up the autoloader
 */
require_once __DIR__ . '/../vendor/autoload.php';