Permalink
Browse files

added tests configuration

  • Loading branch information...
1 parent 7b6e399 commit c8af2f552c94ed9532693be053a712f6f5bd5cd3 @everzet everzet committed Feb 21, 2012
Showing with 41 additions and 0 deletions.
  1. +3 −0 .gitignore
  2. +18 −0 Tests/bootstrap.php
  3. +20 −0 phpunit.xml.dist
View
@@ -0,0 +1,3 @@
+composer.phar
+composer.lock
+vendor
View
@@ -0,0 +1,18 @@
+<?php
+
+if (file_exists($file = __DIR__.'/../vendor/.composer/autoload.php')) {
+ $autoload = require_once $file;
+} else {
+ throw new RuntimeException('Install dependencies to run test suite.');
+}
+
+spl_autoload_register(function($class) {
+ if (0 === strpos($class, 'Knp\\Bundle\\RadBundle\\')) {
+ $path = __DIR__.'/../'.implode('/', array_slice(explode('\\', $class), 3)).'.php';
+ if (!stream_resolve_include_path($path)) {
+ return false;
+ }
+ require_once $path;
+ return true;
+ }
+});
View
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<phpunit colors="false" bootstrap="Tests/bootstrap.php">
+ <testsuites>
+ <testsuite name="KnpMenuBundle Test Suite">
+ <directory suffix="Test.php">./Tests/</directory>
+ </testsuite>
+ </testsuites>
+
+ <filter>
+ <whitelist>
+ <directory>./</directory>
+ <exclude>
+ <directory>./Resources</directory>
+ <directory>./Tests</directory>
+ <directory>./vendor</directory>
+ </exclude>
+ </whitelist>
+ </filter>
+</phpunit>

0 comments on commit c8af2f5

Please sign in to comment.