Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove AllTests approach to PHPUnit and work with a phpunit.xml.dist …

…from the top level of the repository.
  • Loading branch information...
commit 983dd1d19fc80339d7dd855216e925dbefa86c78 1 parent 8e8a2c0
Benjamin Eberlei beberlei authored
24 tests/dbproperties.xml.dev → phpunit.xml.dist
View
@@ -8,18 +8,30 @@
2) Edit the file and fill in your settings (database name, type, username, etc.)
Just change the "value"s, not the names of the var elements.
3) To run the tests against the database type the following from within the
- tests/ folder: phpunit --configuration <filename> ...
- Example: phpunit --configuration mysqlconf.xml AllTests
+ tests/ folder: phpunit -c <filename> ...
+ Example: phpunit -c mysqlconf.xml
-->
-<phpunit>
+<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"
+>
<php>
<!-- "Real" test database -->
+ <!-- Uncomment, otherwise SQLite runs
<var name="db_type" value="pdo_mysql"/>
<var name="db_host" value="localhost" />
<var name="db_username" value="root" />
<var name="db_password" value="" />
<var name="db_name" value="doctrine_tests" />
<var name="db_port" value="3306"/>
+ -->
<!--<var name="db_event_subscribers" value="Doctrine\DBAL\Event\Listeners\OracleSessionInit">-->
<!-- Database for temporary connections (i.e. to drop/create the main database) -->
@@ -30,4 +42,10 @@
<var name="tmpdb_name" value="doctrine_tests_tmp" />
<var name="tmpdb_port" value="3306"/>
</php>
+
+ <testsuites>
+ <testsuite name="Doctrine DBAL Test Suite">
+ <directory>./tests/Doctrine/Tests/DBAL</directory>
+ </testsuite>
+ </testsuites>
</phpunit>
33 tests/Doctrine/Tests/AllTests.php
View
@@ -1,33 +0,0 @@
-<?php
-
-namespace Doctrine\Tests;
-
-use Doctrine\Tests\Common;
-use Doctrine\Tests\DBAL;
-
-if (!defined('PHPUnit_MAIN_METHOD')) {
- define('PHPUnit_MAIN_METHOD', 'AllTests::main');
-}
-
-require_once __DIR__ . '/TestInit.php';
-
-class AllTests
-{
- public static function main()
- {
- \PHPUnit_TextUI_TestRunner::run(self::suite());
- }
-
- public static function suite()
- {
- $suite = new DoctrineTestSuite('Doctrine Tests');
-
- $suite->addTest(DBAL\AllTests::suite());
-
- return $suite;
- }
-}
-
-if (PHPUnit_MAIN_METHOD == 'AllTests::main') {
- AllTests::main();
-}
83 tests/Doctrine/Tests/DBAL/AllTests.php
View
@@ -1,83 +0,0 @@
-<?php
-
-namespace Doctrine\Tests\DBAL;
-
-use Doctrine\Tests\DBAL\Component;
-use Doctrine\Tests\DBAL\Ticker;
-use Doctrine\Tests\DBAL\Functional;
-
-if (!defined('PHPUnit_MAIN_METHOD')) {
- define('PHPUnit_MAIN_METHOD', 'Dbal_Platforms_AllTests::main');
-}
-
-require_once __DIR__ . '/../TestInit.php';
-
-class AllTests
-{
- public static function main()
- {
- \PHPUnit_TextUI_TestRunner::run(self::suite());
- }
-
- public static function suite()
- {
- $suite = new \Doctrine\Tests\DbalTestSuite('Doctrine DBAL');
-
- // Platform tests
- $suite->addTestSuite('Doctrine\Tests\DBAL\Platforms\SqlitePlatformTest');
- $suite->addTestSuite('Doctrine\Tests\DBAL\Platforms\MySqlPlatformTest');
- $suite->addTestSuite('Doctrine\Tests\DBAL\Platforms\PostgreSqlPlatformTest');
- $suite->addTestSuite('Doctrine\Tests\DBAL\Platforms\MsSqlPlatformTest');
- $suite->addTestSuite('Doctrine\Tests\DBAL\Platforms\OraclePlatformTest');
- $suite->addTestSuite('Doctrine\Tests\DBAL\Platforms\ReservedKeywordsValidatorTest');
-
- // Type tests
- $suite->addTestSuite('Doctrine\Tests\DBAL\Types\ArrayTest');
- $suite->addTestSuite('Doctrine\Tests\DBAL\Types\ObjectTest');
- $suite->addTestSuite('Doctrine\Tests\DBAL\Types\DateTimeTest');
- $suite->addTestSuite('Doctrine\Tests\DBAL\Types\DateTimeTzTest');
- $suite->addTestSuite('Doctrine\Tests\DBAL\Types\VarDateTimeTest');
- $suite->addTestSuite('Doctrine\Tests\DBAL\Types\DateTest');
- $suite->addTestSuite('Doctrine\Tests\DBAL\Types\TimeTest');
- $suite->addTestSuite('Doctrine\Tests\DBAL\Types\BooleanTest');
- $suite->addTestSuite('Doctrine\Tests\DBAL\Types\DecimalTest');
- $suite->addTestSuite('Doctrine\Tests\DBAL\Types\IntegerTest');
- $suite->addTestSuite('Doctrine\Tests\DBAL\Types\SmallIntTest');
- $suite->addTestSuite('Doctrine\Tests\DBAL\Types\StringTest');
- $suite->addTestSuite('Doctrine\Tests\DBAL\Types\FloatTest');
-
- // Schema tests
- $suite->addTestSuite('Doctrine\Tests\DBAL\Schema\ColumnTest');
- $suite->addTestSuite('Doctrine\Tests\DBAL\Schema\IndexTest');
- $suite->addTestSuite('Doctrine\Tests\DBAL\Schema\TableTest');
- $suite->addTestSuite('Doctrine\Tests\DBAL\Schema\SchemaTest');
- $suite->addTestSuite('Doctrine\Tests\DBAL\Schema\Visitor\SchemaSqlCollectorTest');
- $suite->addTestSuite('Doctrine\Tests\DBAL\Schema\ComparatorTest');
- $suite->addTestSuite('Doctrine\Tests\DBAL\Schema\SchemaDiffTest');
-
- // Query Builder tests
- $suite->addTestSuite('Doctrine\Tests\DBAL\Query\Expression\CompositeExpressionTest');
- $suite->addTestSuite('Doctrine\Tests\DBAL\Query\Expression\ExpressionBuilderTest');
- $suite->addTestSuite('Doctrine\Tests\DBAL\Query\QueryBuilderTest');
-
- // Driver manager test
- $suite->addTestSuite('Doctrine\Tests\DBAL\DriverManagerTest');
-
- // Connection test
- $suite->addTestSuite('Doctrine\Tests\DBAL\ConnectionTest');
- $suite->addTestSuite('Doctrine\Tests\DBAL\SQLParserUtilsTest');
-
- // Events and Listeners
- $suite->addTestSuite('Doctrine\Tests\DBAL\Events\OracleSessionInitTest');
- $suite->addTestSuite('Doctrine\Tests\DBAL\Events\MysqlSessionInitTest');
-
- // All Functional DBAL tests
- $suite->addTest(Functional\AllTests::suite());
-
- return $suite;
- }
-}
-
-if (PHPUnit_MAIN_METHOD == 'Dbal_Platforms_AllTests::main') {
- AllTests::main();
-}
53 tests/Doctrine/Tests/DBAL/Functional/AllTests.php
View
@@ -1,53 +0,0 @@
-<?php
-
-namespace Doctrine\Tests\DBAL\Functional;
-
-use Doctrine\Tests\DBAL\Functional;
-use Doctrine\Tests\TestUtil;
-
-if (!defined('PHPUnit_MAIN_METHOD')) {
- define('PHPUnit_MAIN_METHOD', 'Dbal_Functional_AllTests::main');
-}
-
-require_once __DIR__ . '/../../TestInit.php';
-
-class AllTests
-{
- public static function main()
- {
- \PHPUnit_TextUI_TestRunner::run(self::suite());
- }
-
- public static function suite()
- {
- $suite = new \Doctrine\Tests\DbalFunctionalTestSuite('Doctrine Dbal Functional');
-
- $conn= TestUtil::getConnection();
- $sm = $conn->getSchemaManager();
-
- if ($sm instanceof \Doctrine\DBAL\Schema\SqliteSchemaManager) {
- $suite->addTestSuite('Doctrine\Tests\DBAL\Functional\Schema\SqliteSchemaManagerTest');
- } else if ($sm instanceof \Doctrine\DBAL\Schema\MySqlSchemaManager) {
- $suite->addTestSuite('Doctrine\Tests\DBAL\Functional\Schema\MySqlSchemaManagerTest');
- } else if ($sm instanceof \Doctrine\DBAL\Schema\PostgreSqlSchemaManager) {
- $suite->addTestSuite('Doctrine\Tests\DBAL\Functional\Schema\PostgreSqlSchemaManagerTest');
- } else if ($sm instanceof \Doctrine\DBAL\Schema\OracleSchemaManager) {
- $suite->addTestSuite('Doctrine\Tests\DBAL\Functional\Schema\OracleSchemaManagerTest');
- } else if ($sm instanceof \Doctrine\DBAL\Schema\DB2SchemaManager) {
- $suite->addTestSuite('Doctrine\Tests\DBAL\Functional\Schema\Db2SchemaManagerTest');
- }
- $suite->addTestSuite('Doctrine\Tests\DBAL\Functional\ConnectionTest');
- $suite->addTestSuite('Doctrine\Tests\DBAL\Functional\DataAccessTest');
- $suite->addTestSuite('Doctrine\Tests\DBAL\Functional\WriteTest');
- $suite->addTestSuite('Doctrine\Tests\DBAL\Functional\LoggingTest');
- $suite->addTestSuite('Doctrine\Tests\DBAL\Functional\TypeConversionTest');
- $suite->addTestSuite('Doctrine\Tests\DBAL\Functional\PortabilityTest');
- $suite->addTestSuite('Doctrine\Tests\DBAL\Functional\ModifyLimitQueryTest');
-
- return $suite;
- }
-}
-
-if (PHPUnit_MAIN_METHOD == 'Dbal_Functional_AllTests::main') {
- AllTests::main();
-}
8 tests/Doctrine/Tests/DbalFunctionalTestSuite.php
View
@@ -1,8 +0,0 @@
-<?php
-
-namespace Doctrine\Tests;
-
-class DbalFunctionalTestSuite extends DbalTestSuite
-{
-
-}
10 tests/Doctrine/Tests/DbalTestSuite.php
View
@@ -1,10 +0,0 @@
-<?php
-
-namespace Doctrine\Tests;
-
-/**
- * The outermost test suite for all dbal related testcases & suites.
- */
-class DbalTestSuite extends DoctrineTestSuite
-{
-}
11 tests/Doctrine/Tests/DoctrineTestSuite.php
View
@@ -1,11 +0,0 @@
-<?php
-
-namespace Doctrine\Tests;
-
-/**
- * Doctrine's basic test suite implementation. Provides functionality needed by all
- * test suites.
- */
-class DoctrineTestSuite extends \PHPUnit_Framework_TestSuite
-{
-}
10 tests/Doctrine/Tests/TestInit.php
View
@@ -11,14 +11,12 @@
$classLoader = new \Doctrine\Common\ClassLoader('Doctrine\Common', __DIR__ . '/../../../lib/vendor/doctrine-common/lib');
$classLoader->register();
-$classLoader = new \Doctrine\Common\ClassLoader('Doctrine');
+$classLoader = new \Doctrine\Common\ClassLoader('Doctrine\DBAL', __DIR__ . '/../../../lib');
+$classLoader->register();
+
+$classLoader = new \Doctrine\Common\ClassLoader('Doctrine\Tests', __DIR__ . '/../../');
$classLoader->register();
$classLoader = new \Doctrine\Common\ClassLoader('Symfony', __DIR__ . "/../../../lib/vendor");
$classLoader->register();
-set_include_path(
- __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'lib'
- . PATH_SEPARATOR .
- get_include_path()
-);
Please sign in to comment.
Something went wrong with that request. Please try again.