Skip to content

Commit

Permalink
added a phpunit.xml.dist and bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
lsmith77 committed Apr 25, 2011
1 parent 37f91ba commit 2f6209e
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

require_once $_SERVER['SYMFONY'].'/Symfony/Component/ClassLoader/UniversalClassLoader.php';

use Symfony\Component\ClassLoader\UniversalClassLoader;

$loader = new UniversalClassLoader();
$loader->registerNamespace('Symfony', $_SERVER['SYMFONY']);
$loader->registerNamespace('Doctrine', $_SERVER['DOCTRINE']);
$loader->register();

spl_autoload_register(function($class)
{
if (0 === strpos($class, 'FOS\\RestBundle\\')) {
$path = implode('/', array_slice(explode('\\', $class), 2)).'.php';
require_once __DIR__.'/../'.$path;
return true;
}
});
24 changes: 24 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit bootstrap="./Tests/bootstrap.php" color="true">
<php>
<server name="SYMFONY" value="../../../symfony/src" />
<server name="DOCTRINE" value="../../../doctrine-common/lib" />
</php>

<testsuites>
<testsuite name="FOSRestBundle">
<directory suffix="Test.php">./Tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<directory>./</directory>
<exclude>
<directory>./Resources</directory>
<directory>./Tests</directory>
</exclude>
</whitelist>
</filter>
</phpunit>

0 comments on commit 2f6209e

Please sign in to comment.