Permalink
Browse files

Fix tests and add phpunit configuration

  • Loading branch information...
1 parent d3219bc commit cc923e2b56125046aa8cf6dde907a0cab3745233 @richardfullmer richardfullmer committed Jan 4, 2012
Showing with 48 additions and 1 deletion.
  1. +4 −0 .gitignore
  2. +1 −1 Mapping/Driver/YamlDriver.php
  3. +22 −0 Tests/bootstrap.php
  4. +21 −0 phpunit.xml.dist
View
@@ -0,0 +1,4 @@
+phpunit.xml
+vendor
+composer.lock
+composer.phar
@@ -2,7 +2,7 @@
namespace Doctrine\Bundle\Mapping\Driver;
-use Doctrine\OXM\Mapping\Driver\YamlDriver as BaseYamlDriver;
+use Doctrine\OXM\Mapping\Driver\YAMLDriver as BaseYamlDriver;
use Doctrine\OXM\OXMException;
/**
View
@@ -0,0 +1,22 @@
+<?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, 'Doctrine\\Bundle\\OXMBundle\\')) {
+ $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,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<phpunit bootstrap="./Tests/bootstrap.php" colors="true">
+
+ <testsuites>
+ <testsuite name="Doctrine OXMBundle 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 cc923e2

Please sign in to comment.