Skip to content

Commit 539544a

Browse files
committed
Update code standards
1 parent 04c2fb9 commit 539544a

File tree

5 files changed

+11
-12
lines changed

5 files changed

+11
-12
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ jobs:
5252

5353
- name: Install dependencies
5454
run: |
55-
composer require laravel/framework=${{ matrix.laravel }} --ignore-platform-req=php --no-update
56-
composer install --prefer-dist --no-progress --ignore-platform-req=php
55+
composer require laravel/framework=${{ matrix.laravel }} --no-update
56+
composer install --prefer-dist --no-progress
5757
5858
- name: Validate composer.json and composer.lock
5959
run: composer validate
@@ -74,6 +74,4 @@ jobs:
7474
working-directory: framework-tests
7575

7676
- name: Run test suite
77-
run: |
78-
php vendor/bin/codecept build -c framework-tests
79-
php vendor/bin/codecept run Functional -c framework-tests
77+
run: php vendor/bin/codecept run Functional -c framework-tests

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"require-dev": {
2828
"codeception/module-asserts": "^1.3",
2929
"codeception/module-rest": "^1.2",
30+
"laravel/framework": "^6.0 | ^7.0 | ^8.0",
3031
"vlucas/phpdotenv": "^3.6 | ^4.1 | ^5.2"
3132
},
3233
"autoload": {

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ A Codeception module for Laravel framework.
1010
## Requirements
1111

1212
* `Laravel 6` or higher.
13-
* `PHP 7.3` or higher.
13+
* `PHP 7.4` or higher.
1414

1515
## Installation
1616

src/Codeception/Module/Laravel/InteractsWithAuthentication.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function amLoggedAs($user, string $guardName = null): void
5757
$guard = $this->getAuth()->guard($guardName);
5858
$this->assertTrue(
5959
$guard->attempt($user)
60-
, 'Failed to login with credentials ' . json_encode($user)
60+
, 'Failed to login with credentials ' . json_encode($user, JSON_THROW_ON_ERROR)
6161
);
6262
}
6363

src/Codeception/Module/Laravel/InteractsWithEloquent.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function dontSeeRecord($table, $attributes = []): void
4343

4444
if (class_exists($table)) {
4545
if ($foundMatchingRecord = (bool)$this->findModel($table, $attributes)) {
46-
$this->fail("Unexpectedly found matching {$table} with " . json_encode($attributes));
46+
$this->fail("Unexpectedly found matching {$table} with " . json_encode($attributes, JSON_THROW_ON_ERROR));
4747
}
4848
} elseif ($foundMatchingRecord = (bool)$this->findRecord($table, $attributes)) {
4949
$this->fail("Unexpectedly found matching record in table '{$table}'");
@@ -89,7 +89,7 @@ public function grabRecord($table, $attributes = [])
8989
{
9090
if (class_exists($table)) {
9191
if (!$model = $this->findModel($table, $attributes)) {
92-
$this->fail("Could not find {$table} with " . json_encode($attributes));
92+
$this->fail("Could not find {$table} with " . json_encode($attributes, JSON_THROW_ON_ERROR));
9393
}
9494

9595
return $model;
@@ -275,14 +275,14 @@ public function seeNumRecords(int $expectedNum, string $table, array $attributes
275275
$this->assertSame(
276276
$expectedNum,
277277
$currentNum,
278-
"The number of found {$table} ({$currentNum}) does not match expected number {$expectedNum} with " . json_encode($attributes)
278+
"The number of found {$table} ({$currentNum}) does not match expected number {$expectedNum} with " . json_encode($attributes, JSON_THROW_ON_ERROR)
279279
);
280280
} else {
281281
$currentNum = $this->countRecords($table, $attributes);
282282
$this->assertSame(
283283
$expectedNum,
284284
$currentNum,
285-
"The number of found records in table {$table} ({$currentNum}) does not match expected number $expectedNum with " . json_encode($attributes)
285+
"The number of found records in table {$table} ({$currentNum}) does not match expected number $expectedNum with " . json_encode($attributes, JSON_THROW_ON_ERROR)
286286
);
287287
}
288288
}
@@ -310,7 +310,7 @@ public function seeRecord($table, $attributes = []): void
310310

311311
if (class_exists($table)) {
312312
if (!$foundMatchingRecord = (bool)$this->findModel($table, $attributes)) {
313-
$this->fail("Could not find {$table} with " . json_encode($attributes));
313+
$this->fail("Could not find {$table} with " . json_encode($attributes, JSON_THROW_ON_ERROR));
314314
}
315315
} elseif (!$foundMatchingRecord = (bool)$this->findRecord($table, $attributes)) {
316316
$this->fail("Could not find matching record in table '{$table}'");

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy