Skip to content

Commit 2ea2b3a

Browse files
committed
Fix GitHub Actions for PR's (#11)
1 parent 05f7bb7 commit 2ea2b3a

File tree

3 files changed

+24
-8
lines changed

3 files changed

+24
-8
lines changed

.github/workflows/main.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,9 @@ jobs:
2828
uses: actions/checkout@v2
2929
with:
3030
repository: codeception/laravel-module-tests
31-
submodules: recursive
31+
path: framework-tests
3232
ref: main
3333

34-
- name: Validate composer.json and composer.lock
35-
run: composer validate
36-
3734
- name: Get composer cache directory
3835
id: composer-cache
3936
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
@@ -45,13 +42,28 @@ jobs:
4542
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
4643
restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer-
4744

45+
- name: Install dependencies
46+
run: composer install --prefer-dist --no-progress
47+
48+
- name: Validate composer.json and composer.lock
49+
run: composer validate
50+
working-directory: framework-tests
51+
4852
- name: Install Laravel Sample
49-
run: composer update --no-progress
53+
run: |
54+
composer remove codeception/module-laravel --dev --no-update
55+
composer update --no-progress
56+
working-directory: framework-tests
5057

5158
- name: Prepare the test environment and run test suite
5259
run: |
5360
cp .env.testing .env
5461
php artisan config:cache
5562
touch database/database.sqlite
5663
php artisan migrate --seed --env=testing --force
57-
php vendor/bin/codecept run Functional
64+
working-directory: framework-tests
65+
66+
- name: Run test suite
67+
run: |
68+
php vendor/bin/codecept build -c framework-tests
69+
php vendor/bin/codecept run Functional -c framework-tests

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
},
2727
"require-dev": {
2828
"codeception/module-asserts": "^1.3",
29-
"codeception/module-rest": "^1.2"
29+
"codeception/module-rest": "^1.2",
30+
"vlucas/phpdotenv": "^3.6 | ^4.1 | ^5.2"
3031
},
3132
"autoload": {
3233
"classmap": ["src/"]

src/Codeception/Module/Laravel.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,10 @@ public function seeCurrentActionIs(string $action): void
536536
$this->getRouteByAction($action); // Fails if route does not exists
537537
$currentRoute = $this->app->request->route();
538538
$currentAction = $currentRoute ? $currentRoute->getActionName() : '';
539-
$currentAction = ltrim(str_replace($this->getRootControllerNamespace(), "", $currentAction), '\\');
539+
$currentAction = ltrim(
540+
str_replace( (string)$this->getRootControllerNamespace(), '', $currentAction),
541+
'\\'
542+
);
540543

541544
if ($currentAction != $action) {
542545
$this->fail("Current action is \"$currentAction\"");

0 commit comments

Comments
 (0)