~ubuntu-branches/ubuntu/wily/php-doctrine-common/wily-proposed

« back to all changes in this revision

Viewing changes to .pc/0001-Use-ClassLoader-from-Symfony-instead-of-autoload.patch/tests/Doctrine/Tests/TestInit.php

  • Committer: Package Import Robot
  • Author(s): David Prévot
  • Date: 2014-06-15 11:26:00 UTC
  • mfrom: (2.1.1 experimental)
  • Revision ID: package-import@ubuntu.com-20140615112600-sg4mgpwq9sfg4mre
Tags: 2.4.2-2
* Upload to unstable
* No tests if DEB_BUILD_OPTIONS contains nocheck

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
/*
 
3
 * This file bootstraps the test environment.
 
4
 */
 
5
namespace Doctrine\Tests;
 
6
 
 
7
error_reporting(E_ALL | E_STRICT);
 
8
 
 
9
// register silently failing autoloader
 
10
spl_autoload_register(function($class)
 
11
{
 
12
    if (0 === strpos($class, 'Doctrine\Tests\\')) {
 
13
        $path = __DIR__.'/../../'.strtr($class, '\\', '/').'.php';
 
14
        if (is_file($path) && is_readable($path)) {
 
15
            require_once $path;
 
16
 
 
17
            return true;
 
18
        }
 
19
    }
 
20
});
 
21
 
 
22
require_once __DIR__ . "/../../../vendor/autoload.php";
 
23
 
 
24
\Doctrine\Common\Annotations\AnnotationRegistry::registerAutoloadNamespace(
 
25
    'Doctrine\Tests\Common\Annotations\Fixtures', __DIR__ . '/../../'
 
26
);