light bootstrap for unit tests

This commit is contained in:
Trismegiste 2013-05-10 19:51:19 +02:00
parent b82330941f
commit 148bf4934d
2 changed files with 18 additions and 0 deletions

8
Tests/bootstrap.php Normal file
View File

@ -0,0 +1,8 @@
<?php
spl_autoload_register(function ($class) {
if (preg_match('#^DesignPatterns\\\\(.+)$#', $class, $ret)) {
$relPath = str_replace('\\', DIRECTORY_SEPARATOR, $ret[1]);
require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . $relPath . '.php';
}
});

10
phpunit.xml Normal file
View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="Tests/bootstrap.php" colors="true">
<testsuites>
<testsuite name="Design Patterns tests">
<directory>./Tests</directory>
</testsuite>
</testsuites>
</phpunit>