Skip to content

Commit

Permalink
Sync changes with yiisoft/app-api#146 (#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
xepozz authored Nov 3, 2022
1 parent 531bb26 commit cf15dc4
Show file tree
Hide file tree
Showing 12 changed files with 49 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
YII_ENV=
YII_ENV=dev
YII_DEBUG=true
2 changes: 2 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
YII_ENV=test
YII_DEBUG=false
8 changes: 2 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,11 @@ jobs:

- name: Run tests codeception
if: matrix.os != 'ubuntu-latest' || matrix.php != '8.0'
run: |
php -S 127.0.0.1:8080 -t public > ./runtime/yii.log 2>&1 &
vendor/bin/codecept run
run: vendor/bin/codecept run

- name: Run tests codeception with coverage
if: matrix.os == 'ubuntu-latest' && matrix.php == '8.0'
run: |
php -S 127.0.0.1:8080 -t public > ./runtime/yii.log 2>&1 &
vendor/bin/codecept run --coverage-xml
run: vendor/bin/codecept run --coverage-xml

- name: Upload coverage to codecov
if: matrix.os == 'ubuntu-latest' && matrix.php == '8.0'
Expand Down
3 changes: 3 additions & 0 deletions codeception.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ coverage:
exclude:
- src/Asset/*
- src/Installer.php
params:
- .env
- .env.test
17 changes: 17 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,23 @@
"config-plugin-options": {
"source-directory": "config"
},
"config-plugin-environments": {
"dev": {
"params": [
"test/params.php"
]
},
"prod": {
"params": [
"test/params.php"
]
},
"test": {
"params": [
"test/params.php"
]
}
},
"config-plugin": {
"common": "common/*.php",
"params": [
Expand Down
5 changes: 5 additions & 0 deletions config/dev/params.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

declare(strict_types=1);

return [];
5 changes: 5 additions & 0 deletions config/prod/params.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

declare(strict_types=1);

return [];
5 changes: 5 additions & 0 deletions config/test/params.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

declare(strict_types=1);

return [];
19 changes: 9 additions & 10 deletions tests/Acceptance.suite.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# Codeception Test Suite Configuration
#
# Suite for acceptance tests.
# Perform tests in browser using the WebDriver or PhpBrowser.
# If you need both WebDriver and PHPBrowser tests - create a separate suite.

actor: AcceptanceTester
extensions:
enabled:
- Codeception\Extension\RunProcess:
0: php -d variables_order=EGPCS -S 127.0.0.1:8080 -t public
sleep: 1
modules:
enabled:
- PhpBrowser:
url: http://localhost:8080
step_decorators: ~
enabled:
- PhpBrowser:
url: http://127.0.0.1:8080
step_decorators: ~
1 change: 0 additions & 1 deletion tests/Cli.suite.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
actor: CliTester
suite_namespace: App\Tests\Cli
modules:
# enable helpers as array
enabled: [Cli]
7 changes: 0 additions & 7 deletions tests/Functional.suite.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
# Codeception Test Suite Configuration
#
# Suite for functional tests
# Emulate web requests and make application process them
# Include one of framework modules (Symfony, Yii2, Laravel, Phalcon4) to use it
# Remove this suite if you don't use frameworks

actor: FunctionalTester
modules:
enabled:
Expand Down
4 changes: 0 additions & 4 deletions tests/Unit.suite.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# Codeception Test Suite Configuration
#
# Suite for unit or integration tests.

actor: UnitTester
modules:
enabled:
Expand Down

0 comments on commit cf15dc4

Please sign in to comment.