Commit 983dd1d1 authored by Benjamin Eberlei's avatar Benjamin Eberlei

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

Remove AllTests approach to PHPUnit and work with a phpunit.xml.dist from the top level of the repository.
parent 8e8a2c06
...@@ -8,18 +8,30 @@ ...@@ -8,18 +8,30 @@
2) Edit the file and fill in your settings (database name, type, username, etc.) 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. 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 3) To run the tests against the database type the following from within the
tests/ folder: phpunit --configuration <filename> ... tests/ folder: phpunit -c <filename> ...
Example: phpunit --configuration mysqlconf.xml AllTests 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> <php>
<!-- "Real" test database --> <!-- "Real" test database -->
<!-- Uncomment, otherwise SQLite runs
<var name="db_type" value="pdo_mysql"/> <var name="db_type" value="pdo_mysql"/>
<var name="db_host" value="localhost" /> <var name="db_host" value="localhost" />
<var name="db_username" value="root" /> <var name="db_username" value="root" />
<var name="db_password" value="" /> <var name="db_password" value="" />
<var name="db_name" value="doctrine_tests" /> <var name="db_name" value="doctrine_tests" />
<var name="db_port" value="3306"/> <var name="db_port" value="3306"/>
-->
<!--<var name="db_event_subscribers" value="Doctrine\DBAL\Event\Listeners\OracleSessionInit">--> <!--<var name="db_event_subscribers" value="Doctrine\DBAL\Event\Listeners\OracleSessionInit">-->
<!-- Database for temporary connections (i.e. to drop/create the main database) --> <!-- Database for temporary connections (i.e. to drop/create the main database) -->
...@@ -30,4 +42,10 @@ ...@@ -30,4 +42,10 @@
<var name="tmpdb_name" value="doctrine_tests_tmp" /> <var name="tmpdb_name" value="doctrine_tests_tmp" />
<var name="tmpdb_port" value="3306"/> <var name="tmpdb_port" value="3306"/>
</php> </php>
<testsuites>
<testsuite name="Doctrine DBAL Test Suite">
<directory>./tests/Doctrine/Tests/DBAL</directory>
</testsuite>
</testsuites>
</phpunit> </phpunit>
\ No newline at end of file
<?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();
}
\ No newline at end of file
<?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();
}
<?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();
}
<?php
namespace Doctrine\Tests;
class DbalFunctionalTestSuite extends DbalTestSuite
{
}
\ No newline at end of file
<?php
namespace Doctrine\Tests;
/**
* The outermost test suite for all dbal related testcases & suites.
*/
class DbalTestSuite extends DoctrineTestSuite
{
}
\ No newline at end of file
<?php
namespace Doctrine\Tests;
/**
* Doctrine's basic test suite implementation. Provides functionality needed by all
* test suites.
*/
class DoctrineTestSuite extends \PHPUnit_Framework_TestSuite
{
}
\ No newline at end of file
...@@ -11,14 +11,12 @@ require_once __DIR__ . '/../../../lib/vendor/doctrine-common/lib/Doctrine/Common ...@@ -11,14 +11,12 @@ require_once __DIR__ . '/../../../lib/vendor/doctrine-common/lib/Doctrine/Common
$classLoader = new \Doctrine\Common\ClassLoader('Doctrine\Common', __DIR__ . '/../../../lib/vendor/doctrine-common/lib'); $classLoader = new \Doctrine\Common\ClassLoader('Doctrine\Common', __DIR__ . '/../../../lib/vendor/doctrine-common/lib');
$classLoader->register(); $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->register();
$classLoader = new \Doctrine\Common\ClassLoader('Symfony', __DIR__ . "/../../../lib/vendor"); $classLoader = new \Doctrine\Common\ClassLoader('Symfony', __DIR__ . "/../../../lib/vendor");
$classLoader->register(); $classLoader->register();
set_include_path(
__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'lib'
. PATH_SEPARATOR .
get_include_path()
);
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment