mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-02-07 00:00:56 +01:00
light bootstrap for unit tests
This commit is contained in:
parent
b82330941f
commit
148bf4934d
8
Tests/bootstrap.php
Normal file
8
Tests/bootstrap.php
Normal 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
10
phpunit.xml
Normal 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>
|
Loading…
x
Reference in New Issue
Block a user