Browse files

get vfsStream via composer if its PEAR package not exists

  • Loading branch information...
1 parent f61d9f3 commit 6bca9f836836f4bea2112cd6635a384e862b4db2 @toopay toopay committed May 25, 2012
Showing with 17 additions and 4 deletions.
  1. +2 −3 .travis.yml
  2. +5 −0 composer.json
  3. +10 −1 tests/Bootstrap.php
View
5 .travis.yml
@@ -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"
View
5 composer.json
@@ -0,0 +1,5 @@
+{
+ "require": {
+ "mikey179/vfsStream": "*"
+ }
+}
View
11 tests/Bootstrap.php
@@ -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');

0 comments on commit 6bca9f8

Please sign in to comment.