Skip to content

Commit 9378ba3

Browse files
author
Alexey Samoylov
authored
Merge pull request #7 from lavros/update-skeleton-test
Integrated Travis CI.
2 parents d8f1ec4 + 90d4250 commit 9378ba3

File tree

4 files changed

+43
-4
lines changed

4 files changed

+43
-4
lines changed

.travis.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
language: php
2+
3+
php:
4+
- 5.4
5+
- 5.5
6+
- 5.6
7+
- 7.0
8+
# - hhvm
9+
10+
# faster builds on new travis setup not using sudo
11+
sudo: false
12+
13+
# cache vendor dirs
14+
cache:
15+
directories:
16+
- $HOME/.composer/cache
17+
18+
install:
19+
- travis_retry composer self-update && composer --version
20+
- travis_retry composer global require "fxp/composer-asset-plugin:~1.1.0"
21+
- travis_retry composer update --dev --prefer-dist --no-interaction
22+
# setup application:
23+
- |
24+
./init --env=Development
25+
sed -i s/root/travis/ common/config/main-local.php
26+
sed -i "s/'cookieValidationKey' => ''/'cookieValidationKey' => 'testkey'/" frontend/config/main.php
27+
sed -i "s/'cookieValidationKey' => ''/'cookieValidationKey' => 'testkey'/" backend/config/main.php
28+
29+
before_script:
30+
- mysql -e 'CREATE DATABASE yarcode_test;'
31+
- php yii_test migrate --interactive=0
32+
33+
script:
34+
- composer validate --strict
35+
- composer exec codecept run

composer.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
"minimum-stability": "stable",
1313
"require": {
1414
"php": ">=5.4.0",
15-
"yiisoft/yii2": ">=2.0.7",
16-
"yiisoft/yii2-bootstrap": "*",
17-
"yiisoft/yii2-swiftmailer": "*",
15+
"yiisoft/yii2": "~2.0.7",
16+
"yiisoft/yii2-bootstrap": "~2.0.0",
17+
"yiisoft/yii2-swiftmailer": "~2.0.0",
1818
"yarcode/yii2-base": "^0.3.1",
1919
"kartik-v/yii2-widget-alert": "^1.1",
2020
"kartik-v/yii2-widget-growl": "^1.1",

console/migrations/m000000_001001_roles.php

+4
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ public function up()
3636
'pattern' => '/^\d+$/',
3737
]);
3838

39+
if (empty($userId)) {
40+
$userId = 1;
41+
}
42+
3943
$auth->assign($admin, $userId);
4044
}
4145

environments/dev/common/config/test-local.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[
77
'components' => [
88
'db' => [
9-
'dsn' => 'mysql:host=localhost;dbname=yii2advanced_test',
9+
'dsn' => 'mysql:host=localhost;dbname=yarcode_test',
1010
]
1111
],
1212
]

0 commit comments

Comments
 (0)