Skip to content

Commit

Permalink
Merge pull request #20 from Seldaek/tests
Browse files Browse the repository at this point in the history
Optimized boilerplate of unit tests of doctrine-common
  • Loading branch information
guilhermeblanco committed May 5, 2011
2 parents f45c34a + 9639d5c commit d2241e9
Show file tree
Hide file tree
Showing 20 changed files with 32 additions and 203 deletions.
25 changes: 25 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit backupGlobals="false"
backupStaticAttributes="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
bootstrap="./tests/Doctrine/Tests/TestInit.php"
>
<testsuites>
<testsuite name="Doctrine Common Test Suite">
<directory>./tests/Doctrine/</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<directory>./lib/Doctrine/</directory>
</whitelist>
</filter>
</phpunit>
32 changes: 0 additions & 32 deletions tests/Doctrine/Tests/AllTests.php

This file was deleted.

39 changes: 0 additions & 39 deletions tests/Doctrine/Tests/Common/AllTests.php

This file was deleted.

32 changes: 0 additions & 32 deletions tests/Doctrine/Tests/Common/Annotations/AllTests.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

use ReflectionClass, Doctrine\Common\Annotations\AnnotationReader;

require_once __DIR__ . '/../../TestInit.php';

class AnnotationReaderTest extends \Doctrine\Tests\DoctrineTestCase
{
public function testAnnotations()
Expand Down
2 changes: 0 additions & 2 deletions tests/Doctrine/Tests/Common/Annotations/LexerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

use Doctrine\Common\Annotations\Lexer;

require_once __DIR__ . '/../../TestInit.php';

class LexerTest extends \Doctrine\Tests\DoctrineTestCase
{
public function testMarkerAnnotation()
Expand Down
2 changes: 0 additions & 2 deletions tests/Doctrine/Tests/Common/Annotations/ParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

use Doctrine\Common\Annotations\Parser;

require_once __DIR__ . '/../../TestInit.php';

class ParserTest extends \Doctrine\Tests\DoctrineTestCase
{
public function testBasicAnnotations()
Expand Down
34 changes: 0 additions & 34 deletions tests/Doctrine/Tests/Common/Cache/AllTests.php

This file was deleted.

2 changes: 0 additions & 2 deletions tests/Doctrine/Tests/Common/Cache/ApcCacheTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

use Doctrine\Common\Cache\ApcCache;

require_once __DIR__ . '/../../TestInit.php';

class ApcCacheTest extends CacheTest
{
public function setUp()
Expand Down
2 changes: 0 additions & 2 deletions tests/Doctrine/Tests/Common/Cache/ArrayCacheTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

use Doctrine\Common\Cache\ArrayCache;

require_once __DIR__ . '/../../TestInit.php';

class ArrayCacheTest extends CacheTest
{
protected function _getCacheDriver()
Expand Down
2 changes: 0 additions & 2 deletions tests/Doctrine/Tests/Common/Cache/CacheTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace Doctrine\Tests\Common\Cache;

require_once __DIR__ . '/../../TestInit.php';

abstract class CacheTest extends \Doctrine\Tests\DoctrineTestCase
{
public function testBasics()
Expand Down
2 changes: 0 additions & 2 deletions tests/Doctrine/Tests/Common/Cache/MemcacheCacheTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

use Doctrine\Common\Cache\MemcacheCache;

require_once __DIR__ . '/../../TestInit.php';

class MemcacheCacheTest extends CacheTest
{
private $_memcache;
Expand Down
2 changes: 0 additions & 2 deletions tests/Doctrine/Tests/Common/Cache/XcacheCacheTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

use Doctrine\Common\Cache\XcacheCache;

require_once __DIR__ . '/../../TestInit.php';

class XcacheCacheTest extends CacheTest
{
public function setUp()
Expand Down
2 changes: 0 additions & 2 deletions tests/Doctrine/Tests/Common/ClassLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

use Doctrine\Common\ClassLoader;

require_once __DIR__ . '/../TestInit.php';

class ClassLoaderTest extends \Doctrine\Tests\DoctrineTestCase
{
public function testClassLoader()
Expand Down
30 changes: 0 additions & 30 deletions tests/Doctrine/Tests/Common/Collections/AllTests.php

This file was deleted.

2 changes: 0 additions & 2 deletions tests/Doctrine/Tests/Common/Collections/CollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

use Doctrine\Tests;

require_once __DIR__ . '/../../TestInit.php';

class CollectionTest extends \Doctrine\Tests\DoctrineTestCase
{
/**
Expand Down
2 changes: 0 additions & 2 deletions tests/Doctrine/Tests/Common/EventManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
use Doctrine\Common\EventManager;
use Doctrine\Common\EventArgs;

require_once __DIR__ . '/../TestInit.php';

class EventManagerTest extends \Doctrine\Tests\DoctrineTestCase
{
/* Some pseudo events */
Expand Down
11 changes: 0 additions & 11 deletions tests/Doctrine/Tests/DoctrineTestSuite.php

This file was deleted.

4 changes: 3 additions & 1 deletion tests/Doctrine/Tests/TestInit.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
$classLoader->register();

set_include_path(
__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'lib'
__DIR__ . '/../../../lib'
. PATH_SEPARATOR .
__DIR__ . '/../..'
. PATH_SEPARATOR .
get_include_path()
);
6 changes: 4 additions & 2 deletions tests/README.markdown
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Running the Doctrine 2 Testsuite

## Setting up a PHPUnit Configuration XML
## Running tests

..
Execute PHPUnit in the root folder of your doctrine-common clone.

phpunit

## Testing Lock-Support

Expand Down

0 comments on commit d2241e9

Please sign in to comment.