Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Basic PHPUnit configuration and bootstrapper

  • Loading branch information...
commit d6ed535f337a32b951bd3a328bc4c834b9dfbea6 1 parent ca338b6
Michael Rodríguez Torrent / Miquel Rodríguez Telep mrtorrent authored
Showing with 46 additions and 1 deletion.
  1. +2 −1  .gitignore
  2. +19 −0 Tests/bootstrap.php
  3. +25 −0 phpunit.xml.dist
3  .gitignore
View
@@ -1 +1,2 @@
-.DS_Store
+.DS_Store
+phpunit.xml
19 Tests/bootstrap.php
View
@@ -0,0 +1,19 @@
+<?php
+spl_autoload_register(function($class)
+{
+ $class = ltrim($class, '\\');
+ if (0 === strpos($class, 'Hypebeast\\WordpressBundle')) {
+ $path = implode('/', array_slice(explode('\\', $class), 2)) . '.php';
+ require_once __DIR__ . '/../' . $path;
+ }
+});
+
+require_once $_SERVER['SYMFONY'].'/Symfony/Component/ClassLoader/UniversalClassLoader.php';
+
+$loader = new Symfony\Component\ClassLoader\UniversalClassLoader();
+$loader->registerNamespaces(array(
+ 'Symfony' => $_SERVER['SYMFONY'],
+ 'Doctrine\\Common' => $_SERVER['DOCTRINE_COMMON'],
+ 'Doctrine' => $_SERVER['DOCTRINE_ORM'],
+));
+$loader->register();
25 phpunit.xml.dist
View
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<phpunit bootstrap="Tests/bootstrap.php">
+ <php>
+ <!-- override these paths in your phpunit.xml if necessary -->
+ <server name="SYMFONY" value="../../../symfony/src" />
+ <server name="DOCTRINE_COMMON" value="../../../doctrine-common/lib" />
+ <server name="DOCTRINE_ORM" value="../../../doctrine/lib" />
+ </php>
+
+ <testsuites>
+ <testsuite name="WordpressBundle Test Suite">
+ <directory suffix="Test.php">Tests</directory>
+ </testsuite>
+ </testsuites>
+
+ <filter>
+ <whitelist>
+ <directory>.</directory>
+ <exclude>
+ <directory>Tests</directory>
+ </exclude>
+ </whitelist>
+ </filter>
+</phpunit>
Please sign in to comment.
Something went wrong with that request. Please try again.