Skip to content

Commit

Permalink
get vfsStream via composer if its PEAR package not exists
Browse files Browse the repository at this point in the history
  • Loading branch information
toopay committed May 24, 2012
1 parent f61d9f3 commit 6bca9f8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ env:
- DB=pdo/sqlite

before_script:
- sudo pyrus channel-discover pear.bovigo.org
- sudo pyrus install -f bovigo/vfsStream-beta
- phpenv rehash
- curl -s http://getcomposer.org/installer | php
- php composer.phar install
- sh -c "if [ '$DB' = 'pgsql' ] || [ '$DB' = 'pdo/pgsql' ]; then psql -c 'DROP DATABASE IF EXISTS ci_test;' -U postgres; fi"
- sh -c "if [ '$DB' = 'pgsql' ] || [ '$DB' = 'pdo/pgsql' ]; then psql -c 'create database ci_test;' -U postgres; fi"
- sh -c "if [ '$DB' = 'mysql' ] || [ '$DB' = 'pdo/mysql' ]; then mysql -e 'create database IF NOT EXISTS ci_test;'; fi"
Expand Down
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"require": {
"mikey179/vfsStream": "*"
}
}
11 changes: 10 additions & 1 deletion tests/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,17 @@
define('APPPATH', PROJECT_BASE.'application/');
define('VIEWPATH', PROJECT_BASE.'');

// Get vfsStream either via pear or composer
if (file_exists('vfsStream/vfsStream.php'))
{
require_once 'vfsStream/vfsStream.php';
}
else
{
include_once '../vendor/autoload.php';
}

// Prep our test environment
require_once 'vfsStream/vfsStream.php';
include_once $dir.'/mocks/core/common.php';
include_once $dir.'/mocks/autoloader.php';
spl_autoload_register('autoload');
Expand Down

0 comments on commit 6bca9f8

Please sign in to comment.