Skip to content

Commit

Permalink
Switched to composer to run the test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
willdurand committed Apr 20, 2012
1 parent 8ffda73 commit 1f35b6b
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 68 deletions.
10 changes: 4 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/Model/*/map
/Model/*/om
vendor/phing/
vendor/propel/
vendor/symfony/
vendor/Sensio/
Model/*/map
Model/*/om
vendor
composer.lock
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Tests/Command/PropelGeneratorAwareCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ protected function setUp()
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()
Expand Down
12 changes: 6 additions & 6 deletions Tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
}

Expand All @@ -39,10 +39,10 @@ public function getContainer()

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';
}
}
29 changes: 2 additions & 27 deletions Tests/autoload.php.dist
Original file line number Diff line number Diff line change
@@ -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');
6 changes: 6 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "" }
},
Expand Down
27 changes: 0 additions & 27 deletions vendor/install_vendors.php

This file was deleted.

0 comments on commit 1f35b6b

Please sign in to comment.