Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
colinhall17 committed May 11, 2024
2 parents 5892c26 + bdb0de3 commit 6f796ad
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 87 deletions.
33 changes: 0 additions & 33 deletions .github/workflows/psalm.yml

This file was deleted.

80 changes: 37 additions & 43 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,40 @@ name: Tests
on: [push, pull_request]

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest]
php: [7.3, 7.4]
laravel: [6.*, 7.*, 8.*]
dependency-version: [prefer-lowest, prefer-stable]
include:
- laravel: 8.*
testbench: 6.*
- laravel: 7.*
testbench: 5.*
- laravel: 6.*
testbench: 4.*

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v1

- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/.composer/cache/files
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}

- name: Setup PHP
uses: shivammathur/setup-php@v1
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
- name: Execute tests
run: vendor/bin/phpunit
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest]
php: [8.0, 7.4]
laravel: [8.*]
dependency-version: [prefer-lowest, prefer-stable]
include:
- laravel: 8.*
testbench: 6.*

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: fileinfo, dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none

- name: Setup Problem Matches
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
- name: Execute tests
run: vendor/bin/phpunit
11 changes: 4 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,12 @@
}
],
"require": {
"php": "^7.3|^7.4|^8.0|^8.1|^8.2|^8.3|^8.4",
"illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0"
"php": "^8.1|^8.2|^8.3|^8.4",
"illuminate/support": "^10.0|^11.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.16",
"orchestra/testbench": "^4.0|^5.0|^6.0|^7.0|^8.0",
"phpunit/phpunit": "^8.0|^9.0",
"psalm/plugin-laravel": "^1.4",
"vimeo/psalm": "^3.11"
"orchestra/testbench": "^8.0",
"phpunit/phpunit": "^10.0"
},
"autoload": {
"psr-4": {
Expand Down
8 changes: 4 additions & 4 deletions tests/Unit/UuidTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ public function a_model_can_create_with_a_primary_uuid_key()
$test->name = 'Primary Unit Test';
$test->save();

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

$retreived_test = PrimaryTest::whereName('Primary Unit Test')->first();

$this->assertTrue($retreived_test->id != '');
}

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

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

$retreived_test = Test::whereName('Unit Test')->first();

$this->assertTrue($retreived_test->uuid != '');
}
}

0 comments on commit 6f796ad

Please sign in to comment.