Skip to content

Commit

Permalink
Merge pull request #14017 from SilverFire/test-asset-packagist
Browse files Browse the repository at this point in the history
Switched tests to asset-packagist
  • Loading branch information
SilverFire committed Apr 20, 2017
2 parents 49564ae + f62b53f commit c92cef8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
10 changes: 4 additions & 6 deletions .travis.yml
Expand Up @@ -79,7 +79,6 @@ matrix:
# disable xdebug for performance in composer
- phpenv config-rm xdebug.ini || echo "xdebug is not installed"
- travis_retry composer self-update && composer --version
- travis_retry composer global require "fxp/composer-asset-plugin:^1.3.1" --no-plugins
- travis_retry composer install --prefer-dist --no-interaction
before_script:
- node --version
Expand Down Expand Up @@ -113,12 +112,11 @@ addons:

install:
- |
if [[ $TRAVIS_PHP_VERSION != '5.6' && $TRAVIS_PHP_VERSION != hhv* ]]; then
if [[ $TRAVIS_PHP_VERSION != '7.1' && $TRAVIS_PHP_VERSION != hhv* ]]; then
# disable xdebug for performance reasons when code coverage is not needed. note: xdebug on hhvm is disabled by default
phpenv config-rm xdebug.ini || echo "xdebug is not installed"
fi
- travis_retry composer self-update && composer --version
- travis_retry composer global require "fxp/composer-asset-plugin:^1.3.1" --no-plugins
- export PATH="$HOME/.composer/vendor/bin:$PATH"
# core framework:
- travis_retry composer install --prefer-dist --no-interaction
Expand All @@ -141,9 +139,9 @@ before_script:
- mysql -e "GRANT ALL PRIVILEGES ON *.* TO 'travis'@'localhost' WITH GRANT OPTION;";
- psql -U postgres -c 'CREATE DATABASE yiitest;';

# enable code coverage on PHP 5.6, only one PHP version needs to generate coverage data
# enable code coverage on PHP 7.1, only one PHP version needs to generate coverage data
- |
if [ $TRAVIS_PHP_VERSION = '5.6' ]; then
if [ $TRAVIS_PHP_VERSION = '7.1' ]; then
PHPUNIT_FLAGS="--coverage-clover=coverage.clover"
fi
Expand All @@ -159,7 +157,7 @@ script:

after_script:
- |
if [ $TRAVIS_PHP_VERSION = '5.6' ]; then
if [ $TRAVIS_PHP_VERSION = '7.1' ]; then
travis_retry wget https://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --format=php-clover coverage.clover
fi
6 changes: 6 additions & 0 deletions composer.json
Expand Up @@ -84,6 +84,12 @@
"phpunit/phpunit": "~4.4",
"cebe/indent": "~1.0.2"
},
"repositories": [
{
"type": "composer",
"url": "https://asset-packagist.org"
}
],
"suggest": {
"yiisoft/yii2-coding-standards": "you can use this package to check for code style issues when contributing to yii"
},
Expand Down
4 changes: 4 additions & 0 deletions tests/TestCase.php
Expand Up @@ -68,6 +68,10 @@ protected function mockWebApplication($config = [], $appClass = '\yii\web\Applic
'id' => 'testapp',
'basePath' => __DIR__,
'vendorPath' => $this->getVendorPath(),
'aliases' => [
'@bower' => '@vendor/bower-asset',
'@npm' => '@vendor/npm-asset',
],
'components' => [
'request' => [
'cookieValidationKey' => 'wefJDF8sfdsfSDefwqdxj9oq',
Expand Down

0 comments on commit c92cef8

Please sign in to comment.