1
0
mirror of synced 2024-12-15 07:36:03 +03:00

Fix Testsuite to work with Git

This commit is contained in:
Benjamin Eberlei 2010-04-07 20:35:33 +02:00
parent 3a8d63608a
commit 36b3e180a8
5 changed files with 33 additions and 2 deletions

2
tests/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
Doctrine/Tests/Proxies/
Doctrine/Tests/ORM/Proxy/generated/

View File

@ -12,6 +12,10 @@ class YamlMappingDriverTest extends AbstractMappingDriverTest
{ {
protected function _loadDriver() protected function _loadDriver()
{ {
if (!class_exists('Symfony\Components\Yaml\Yaml', true)) {
$this->markTestSkipped('Please install Symfony YAML Component into the include path of your PHP installation.');
}
return new YamlDriver(__DIR__ . DIRECTORY_SEPARATOR . 'yaml'); return new YamlDriver(__DIR__ . DIRECTORY_SEPARATOR . 'yaml');
} }
} }

View File

@ -40,6 +40,10 @@ class ConvertDoctrine1SchemaTest extends \Doctrine\Tests\OrmTestCase
{ {
public function testTest() public function testTest()
{ {
if (!class_exists('Symfony\Components\Yaml\Yaml', true)) {
$this->markTestSkipped('Please install Symfony YAML Component into the include path of your PHP installation.');
}
$cme = new ClassMetadataExporter(); $cme = new ClassMetadataExporter();
$converter = new ConvertDoctrine1Schema(__DIR__ . '/doctrine1schema'); $converter = new ConvertDoctrine1Schema(__DIR__ . '/doctrine1schema');

View File

@ -37,6 +37,10 @@ class YamlClassMetadataExporterTest extends AbstractClassMetadataExporterTest
{ {
protected function _getType() protected function _getType()
{ {
if (!class_exists('Symfony\Components\Yaml\Yaml', true)) {
$this->markTestSkipped('Please install Symfony YAML Component into the include path of your PHP installation.');
}
return 'yaml'; return 'yaml';
} }
} }

View File

@ -13,8 +13,25 @@ require_once __DIR__ . '/../../../lib/Doctrine/Common/ClassLoader.php';
$classLoader = new \Doctrine\Common\ClassLoader('Doctrine'); $classLoader = new \Doctrine\Common\ClassLoader('Doctrine');
$classLoader->register(); $classLoader->register();
$classLoader = new \Doctrine\Common\ClassLoader('Symfony', __DIR__ . '/../../../lib/vendor'); if (!file_exists(__DIR__."/Proxies")) {
$classLoader->register(); if (!mkdir(__DIR__."/Proxies")) {
throw new Exception("Could not create " . __DIR__."/Proxies Folder.");
}
}
if (!file_exists(__DIR__."/ORM/Proxy/generated")) {
if (!mkdir(__DIR__."/ORM/Proxy/generated")) {
throw new Exception("Could not create " . __DIR__."/ORM/Proxy/generated Folder.");
}
}
spl_autoload_register(function($class) {
if (strpos($class, 'Symfony') === 0) {
$file = str_replace("\\", "/", $class);
if (@fopen($class, "r")) {
require_once ($file);
}
}
});
set_include_path( set_include_path(
__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'lib' __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'lib'