Skip to content

Commit

Permalink
fix!: Add php 8.1 and fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Artem Pakhomov committed Feb 16, 2022
1 parent 3761f2d commit 1f7b2cb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: ['7.4', '8.0']
node: ['7.4', '8.0', '8.1']
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.idea
.vendor
vendor
composer.lock
.phpunit.result.cache
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}
],
"require": {
"php": "^7.4|~8.0.0"
"php": "^7.4|~8.0.0|~8.1"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
Expand Down
14 changes: 8 additions & 6 deletions tests/Unit/DefaultMessageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ public function addRulesTest(): void
*/
public function messagesTest(): void
{
$request = new Request([
$timestamp = time();
$date = date(DATE_W3C, $timestamp);
$request = new Request([
'name' => 'required|string|max:120',
'start_date' => 'required|integer',
'price' => 'nullable|numeric|min:0 ',
Expand All @@ -52,7 +54,7 @@ public function messagesTest(): void
'id' => 'not_in:0',
'field1' => 'regex:/^[\w]+$/',
'uuid' => 'uuid',
'field2' => 'after:' . date(DATE_ATOM, time()),
'field2' => 'after:' . $date,
]);
$messages = $request->messages();
$this->assertEquals(
Expand Down Expand Up @@ -199,13 +201,13 @@ public function messagesTest(): void
),
$messages['uuid.uuid']
);
$this->assertEquals(
$this->assertStringContainsString(
'The field2 must be a date after ',
$this->createKeyValueMessages(
$request->getRulesToMessages()['after'],
'field2',
date(DATE_ATOM, time() - 60)
),
$messages['field2.after']
$date
)
);
}

Expand Down

0 comments on commit 1f7b2cb

Please sign in to comment.