Skip to content

Commit 6f796ad

Browse files
committed
2 parents 5892c26 + bdb0de3 commit 6f796ad

File tree

4 files changed

+45
-87
lines changed

4 files changed

+45
-87
lines changed

.github/workflows/psalm.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/tests.yml

Lines changed: 37 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -3,46 +3,40 @@ name: Tests
33
on: [push, pull_request]
44

55
jobs:
6-
test:
7-
runs-on: ${{ matrix.os }}
8-
strategy:
9-
fail-fast: true
10-
matrix:
11-
os: [ubuntu-latest, windows-latest]
12-
php: [7.3, 7.4]
13-
laravel: [6.*, 7.*, 8.*]
14-
dependency-version: [prefer-lowest, prefer-stable]
15-
include:
16-
- laravel: 8.*
17-
testbench: 6.*
18-
- laravel: 7.*
19-
testbench: 5.*
20-
- laravel: 6.*
21-
testbench: 4.*
22-
23-
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}
24-
25-
steps:
26-
- name: Checkout code
27-
uses: actions/checkout@v1
28-
29-
- name: Cache dependencies
30-
uses: actions/cache@v1
31-
with:
32-
path: ~/.composer/cache/files
33-
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
34-
35-
- name: Setup PHP
36-
uses: shivammathur/setup-php@v1
37-
with:
38-
php-version: ${{ matrix.php }}
39-
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
40-
coverage: none
41-
42-
- name: Install dependencies
43-
run: |
44-
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
45-
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
46-
47-
- name: Execute tests
48-
run: vendor/bin/phpunit
6+
test:
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
fail-fast: true
10+
matrix:
11+
os: [ubuntu-latest, windows-latest]
12+
php: [8.0, 7.4]
13+
laravel: [8.*]
14+
dependency-version: [prefer-lowest, prefer-stable]
15+
include:
16+
- laravel: 8.*
17+
testbench: 6.*
18+
19+
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}
20+
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v2
24+
25+
- name: Setup PHP
26+
uses: shivammathur/setup-php@v2
27+
with:
28+
php-version: ${{ matrix.php }}
29+
extensions: fileinfo, dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
30+
coverage: none
31+
32+
- name: Setup Problem Matches
33+
run: |
34+
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
35+
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
36+
37+
- name: Install dependencies
38+
run: |
39+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
40+
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
41+
- name: Execute tests
42+
run: vendor/bin/phpunit

composer.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,12 @@
1313
}
1414
],
1515
"require": {
16-
"php": "^7.3|^7.4|^8.0|^8.1|^8.2|^8.3|^8.4",
17-
"illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0"
16+
"php": "^8.1|^8.2|^8.3|^8.4",
17+
"illuminate/support": "^10.0|^11.0"
1818
},
1919
"require-dev": {
20-
"friendsofphp/php-cs-fixer": "^2.16",
21-
"orchestra/testbench": "^4.0|^5.0|^6.0|^7.0|^8.0",
22-
"phpunit/phpunit": "^8.0|^9.0",
23-
"psalm/plugin-laravel": "^1.4",
24-
"vimeo/psalm": "^3.11"
20+
"orchestra/testbench": "^8.0",
21+
"phpunit/phpunit": "^10.0"
2522
},
2623
"autoload": {
2724
"psr-4": {

tests/Unit/UuidTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ public function a_model_can_create_with_a_primary_uuid_key()
1515
$test->name = 'Primary Unit Test';
1616
$test->save();
1717

18-
$this->assertDatabaseHas('primary_tests', $test->toArray());
18+
$this->assertDatabaseHas('primary_tests', $test->getAttributes());
1919

2020
$retreived_test = PrimaryTest::whereName('Primary Unit Test')->first();
21-
21+
2222
$this->assertTrue($retreived_test->id != '');
2323
}
2424

@@ -29,10 +29,10 @@ public function a_model_can_create_a_uuid_on_save()
2929
$test->name = 'Unit Test';
3030
$test->save();
3131

32-
$this->assertDatabaseHas('tests', $test->toArray());
32+
$this->assertDatabaseHas('tests', $test->getAttributes());
3333

3434
$retreived_test = Test::whereName('Unit Test')->first();
35-
35+
3636
$this->assertTrue($retreived_test->uuid != '');
3737
}
3838
}

0 commit comments

Comments
 (0)