Browse Source

Fix travis

tags/2.0.7
Alexander Makarov 8 years ago committed by GitHub
parent
commit
e6a20fa7cf
  1. 29
      .travis.yml
  2. 10
      composer.json
  3. 19
      tests/TestCase.php

29
.travis.yml

@ -1,15 +1,21 @@
dist: trusty
language: php
php:
- 5.4
- 5.5
- 5.6
- 7.0
- hhvm
# faster builds on new travis setup not using sudo
- 5.4
- 5.5
- 5.6
- 7.0
- 7.1
matrix:
include:
- php: hhvm
sudo: true
dist: trusty
group: edge
cache:
directories: "$HOME/.composer/cache"
before_install:
- wget https://phar.phpunit.de/phpunit-4.5.1.phar
script:
- php phpunit-4.5.1.phar --verbose $PHPUNIT_FLAGS
sudo: false
# cache vendor dirs
@ -19,7 +25,6 @@ cache:
install:
- travis_retry composer self-update && composer --version
- travis_retry composer global require "fxp/composer-asset-plugin:^1.3.1"
- export PATH="$HOME/.composer/vendor/bin:$PATH"
- travis_retry composer install --prefer-dist --no-interaction

10
composer.json

@ -21,6 +21,12 @@
"yiisoft/yii2": "~2.0.6",
"bower-asset/bootstrap": "3.3.* | 3.2.* | 3.1.*"
},
"repositories": [
{
"type": "composer",
"url": "https://asset-packagist.org"
}
],
"autoload": {
"psr-4": {
"yii\\bootstrap\\": ""
@ -29,10 +35,6 @@
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
},
"asset-installer-paths": {
"npm-asset-library": "vendor/npm",
"bower-asset-library": "vendor/bower"
}
}
}

19
tests/TestCase.php

@ -28,26 +28,19 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase
}
/**
* Populates Yii::$app with a new application
* The application will be destroyed on tearDown() automatically.
* @param array $config The application configuration, if needed
* @param string $appClass name of the application class to create
* @param array $config
* @param string $appClass
*/
protected function mockApplication($config = [], $appClass = '\yii\console\Application')
{
new $appClass(ArrayHelper::merge([
'id' => 'testapp',
'basePath' => __DIR__,
'vendorPath' => dirname(__DIR__) . '/vendor',
], $config));
}
protected function mockWebApplication($config = [], $appClass = '\yii\web\Application')
{
new $appClass(ArrayHelper::merge([
'id' => 'testapp',
'basePath' => __DIR__,
'vendorPath' => dirname(__DIR__) . '/vendor',
'aliases' => [
'@bower' => '@vendor/bower-asset',
'@npm' => '@vendor/npm-asset',
],
'components' => [
'request' => [
'cookieValidationKey' => 'wefJDF8sfdsfSDefwqdxj9oq',

Loading…
Cancel
Save