Switched to composer to run the test suite

This commit is contained in:
William DURAND 2012-04-20 13:22:24 +02:00
parent 8ffda73a75
commit 1f35b6b55b
7 changed files with 22 additions and 68 deletions

10
.gitignore vendored
View file

@ -1,6 +1,4 @@
/Model/*/map
/Model/*/om
vendor/phing/
vendor/propel/
vendor/symfony/
vendor/Sensio/
Model/*/map
Model/*/om
vendor
composer.lock

View file

@ -7,6 +7,8 @@ php:
env:
- SYMFONY_VERSION=origin/master
before_script: php vendor/install_vendors.php
before_script:
- curl -s http://getcomposer.org/installer | php
- php composer.phar --dev install
script: phpunit --coverage-text

View file

@ -26,7 +26,7 @@ class PropelGeneratorAwareCommandTest extends TestCase
parent::setUp();
$this->container = $this->getContainer();
$this->container->setParameter('propel.path', __DIR__ . '/../../vendor/propel');
$this->container->setParameter('propel.path', __DIR__ . '/../../vendor/propel/propel1');
}
public function testGetDatabasesFromSchema()

View file

@ -22,7 +22,7 @@ class TestCase extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!file_exists($file = __DIR__.'/../vendor/propel/runtime/lib/Propel.php')) {
if (!file_exists($file = __DIR__ . '/../vendor/propel/propel1/runtime/lib/Propel.php')) {
$this->markTestSkipped('Propel is not available.');
}
@ -39,10 +39,10 @@ class TestCase extends \PHPUnit_Framework_TestCase
protected function loadPropelQuickBuilder()
{
require_once __DIR__.'/../vendor/propel/runtime/lib/Propel.php';
require_once __DIR__.'/../vendor/propel/runtime/lib/adapter/DBAdapter.php';
require_once __DIR__.'/../vendor/propel/runtime/lib/adapter/DBSQLite.php';
require_once __DIR__.'/../vendor/propel/runtime/lib/connection/PropelPDO.php';
require_once __DIR__.'/../vendor/propel/generator/lib/util/PropelQuickBuilder.php';
require_once __DIR__ . '/../vendor/propel/propel1/runtime/lib/Propel.php';
require_once __DIR__ . '/../vendor/propel/propel1/runtime/lib/adapter/DBAdapter.php';
require_once __DIR__ . '/../vendor/propel/propel1/runtime/lib/adapter/DBSQLite.php';
require_once __DIR__ . '/../vendor/propel/propel1/runtime/lib/connection/PropelPDO.php';
require_once __DIR__ . '/../vendor/propel/propel1/generator/lib/util/PropelQuickBuilder.php';
}
}

View file

@ -1,30 +1,5 @@
<?php
$vendorDir = __DIR__.'/../vendor';
require_once $vendorDir.'/symfony/src/Symfony/Component/ClassLoader/UniversalClassLoader.php';
require_once __DIR__ . '/../vendor/autoload.php';
use Symfony\Component\ClassLoader\UniversalClassLoader;
$loader = new UniversalClassLoader();
$loader->registerNamespaces(array(
'Symfony' => array($vendorDir.'/symfony/src'),
'Sensio\\Bundle\\FrameworkExtraBundle' => array($vendorDir),
));
$loader->registerPrefixes(array(
'Twig_' => $vendorDir.'/symfony/vendor/twig/lib',
));
$loader->register();
set_include_path(get_include_path() . PATH_SEPARATOR . $vendorDir.'/phing/classes');
spl_autoload_register(function($class) {
if (0 === strpos($class, 'Propel\\PropelBundle\\')) {
$path = __DIR__.'/../'.implode('/', array_slice(explode('\\', $class), 2)).'.php';
if (!stream_resolve_include_path($path)) {
return false;
}
require_once $path;
return true;
}
});
set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__ . '/../vendor/phing/phing/classes');

View file

@ -12,6 +12,12 @@
"symfony/framework-bundle": "2.*",
"propel/propel1": "1.6.*"
},
"require-dev": {
"symfony/symfony": "2.1.*",
"phing/phing": "2.4.*",
"sensio/framework-extra-bundle": "*",
"twig/twig": "1.7.*"
},
"autoload": {
"psr-0": { "Propel\\PropelBundle": "" }
},

View file

@ -1,27 +0,0 @@
#!/usr/bin/env php
<?php
set_time_limit(0);
$vendorDir = __DIR__;
$deps = array(
array('symfony', 'http://github.com/symfony/symfony', isset($_SERVER['SYMFONY_VERSION']) ? $_SERVER['SYMFONY_VERSION'] : 'origin/master'),
array('propel', 'http://github.com/propelorm/Propel', isset($_SERVER['PROPEL_VERSION']) ? $_SERVER['PROPEL_VERSION'] : 'origin/master'),
array('phing', 'http://github.com/Xosofox/phing.git', 'origin/master'),
array('Sensio/Bundle/FrameworkExtraBundle', 'http://github.com/sensio/SensioFrameworkExtraBundle.git', 'origin/master'),
);
foreach ($deps as $dep) {
list($name, $url, $rev) = $dep;
echo "> Installing/Updating $name\n";
$installDir = $vendorDir.'/'.$name;
if (!is_dir($installDir)) {
system(sprintf('git clone -q %s %s', escapeshellarg($url), escapeshellarg($installDir)));
}
system(sprintf('cd %s && git fetch -q origin && git reset --hard %s', escapeshellarg($installDir), escapeshellarg($rev)));
}
system(sprintf('cd %s && php vendors.php', escapeshellarg($vendorDir.'/symfony')));