forked from sonata-project/SonataAdminBundle
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix tests, and make them work with http://travis-ci.org
- Loading branch information
Thomas Rabaix
committed
Nov 13, 2011
1 parent
68a5524
commit 81b704a
Showing
5 changed files
with
64 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
language: php | ||
php: 5.3.8 | ||
before_script: php Tests/tests/vendors.php | ||
script: phpunit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
$vendorDir = __DIR__.'/../../vendor'; | ||
require_once $vendorDir.'/symfony/src/Symfony/Component/ClassLoader/UniversalClassLoader.php'; | ||
|
||
use Symfony\Component\ClassLoader\UniversalClassLoader; | ||
|
||
$loader = new UniversalClassLoader(); | ||
$loader->registerNamespaces(array( | ||
'Symfony' => array($vendorDir.'/symfony/src'), | ||
'Knp' => array($vendorDir.'/knpmenu/src'), | ||
)); | ||
$loader->register(); | ||
|
||
spl_autoload_register(function($class) { | ||
if (0 === strpos($class, 'Sonata\\AdminBundle\\')) { | ||
$path = __DIR__.'/../../'.implode('/', array_slice(explode('\\', $class), 2)).'.php'; | ||
|
||
if (!stream_resolve_include_path($path)) { | ||
return false; | ||
} | ||
require_once $path; | ||
return true; | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env php | ||
<?php | ||
|
||
set_time_limit(0); | ||
|
||
|
||
$vendorDir = __DIR__.'/../../vendor'; | ||
if (!is_dir($vendorDir)) { | ||
mkdir($vendorDir); | ||
} | ||
|
||
$deps = array( | ||
array('symfony', 'git://github.com/symfony/symfony.git', 'v2.0.5'), | ||
array('knpmenu', 'git://github.com/knplabs/KnpMenu.git', '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 %s %s', escapeshellarg($url), escapeshellarg($installDir))); | ||
} | ||
|
||
system(sprintf('cd %s && git fetch origin && git reset --hard %s', escapeshellarg($installDir), escapeshellarg($rev))); | ||
} |