summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.travis.yml8
-rw-r--r--composer.json5
-rw-r--r--tests/Bootstrap.php14
3 files changed, 21 insertions, 6 deletions
diff --git a/.travis.yml b/.travis.yml
index 97ea0422d..6a7d37812 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -13,9 +13,8 @@ env:
- DB=pdo/sqlite
before_script:
- - pyrus channel-discover pear.php-tools.net
- - pyrus install http://pear.php-tools.net/get/vfsStream-0.11.2.tgz
- - 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"
@@ -24,5 +23,4 @@ script: phpunit --configuration tests/travis/$DB.phpunit.xml
branches:
only:
- - develop
- - master \ No newline at end of file
+ - develop \ No newline at end of file
diff --git a/composer.json b/composer.json
new file mode 100644
index 000000000..fa6dc02e4
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,5 @@
+{
+ "require": {
+ "mikey179/vfsStream": "*"
+ }
+} \ No newline at end of file
diff --git a/tests/Bootstrap.php b/tests/Bootstrap.php
index 9f89d1be8..71394720a 100644
--- a/tests/Bootstrap.php
+++ b/tests/Bootstrap.php
@@ -12,8 +12,20 @@ define('BASEPATH', PROJECT_BASE.'system/');
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 PROJECT_BASE.'vendor/autoload.php';
+ class_alias('org\bovigo\vfs\vfsStream', 'vfsStream');
+ class_alias('org\bovigo\vfs\vfsStreamDirectory', 'vfsStreamDirectory');
+ class_alias('org\bovigo\vfs\vfsStreamWrapper', 'vfsStreamWrapper');
+}
+
// 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');