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: php:
- 5.4 - 5.4
- 5.5 - 5.5
- 5.6 - 5.6
- 7.0 - 7.0
- hhvm - 7.1
matrix:
# faster builds on new travis setup not using sudo 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 sudo: false
# cache vendor dirs # cache vendor dirs
@ -19,7 +25,6 @@ cache:
install: install:
- travis_retry composer self-update && composer --version - 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" - export PATH="$HOME/.composer/vendor/bin:$PATH"
- travis_retry composer install --prefer-dist --no-interaction - travis_retry composer install --prefer-dist --no-interaction

10
composer.json

@ -21,6 +21,12 @@
"yiisoft/yii2": "~2.0.6", "yiisoft/yii2": "~2.0.6",
"bower-asset/bootstrap": "3.3.* | 3.2.* | 3.1.*" "bower-asset/bootstrap": "3.3.* | 3.2.* | 3.1.*"
}, },
"repositories": [
{
"type": "composer",
"url": "https://asset-packagist.org"
}
],
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"yii\\bootstrap\\": "" "yii\\bootstrap\\": ""
@ -29,10 +35,6 @@
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "2.0.x-dev" "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 * @param array $config
* The application will be destroyed on tearDown() automatically. * @param string $appClass
* @param array $config The application configuration, if needed
* @param string $appClass name of the application class to create
*/ */
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') protected function mockWebApplication($config = [], $appClass = '\yii\web\Application')
{ {
new $appClass(ArrayHelper::merge([ new $appClass(ArrayHelper::merge([
'id' => 'testapp', 'id' => 'testapp',
'basePath' => __DIR__, 'basePath' => __DIR__,
'vendorPath' => dirname(__DIR__) . '/vendor', 'vendorPath' => dirname(__DIR__) . '/vendor',
'aliases' => [
'@bower' => '@vendor/bower-asset',
'@npm' => '@vendor/npm-asset',
],
'components' => [ 'components' => [
'request' => [ 'request' => [
'cookieValidationKey' => 'wefJDF8sfdsfSDefwqdxj9oq', 'cookieValidationKey' => 'wefJDF8sfdsfSDefwqdxj9oq',

Loading…
Cancel
Save