Skip to content

Commit

Permalink
Implements 8.0, 8.1, 8.2 testig with lowest and highest dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
Asisyas committed Feb 18, 2023
1 parent 23d7552 commit 86fc1ee
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 14 deletions.
39 changes: 31 additions & 8 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,36 @@ permissions:
contents: read

jobs:
build:

tests:
runs-on: ubuntu-latest

name: "Tests ${{ matrix.php-version }} deps ${{ matrix.dependency-versions }}"
strategy:
fail-fast: false
matrix:
# normal, highest, non-dev installs
php-version: [ '8.2', '8.1', '8.0' ]
dependency-versions: [ 'highest', 'lowest' ]
include:
# - php-version: '8.2'
# dependency-versions: 'lowest'
- php-version: '8.1'
dependency-versions: 'lowest'
- php-version: '8.0'
dependency-versions: 'lowest'
- php-version: '8.2'
dependency-versions: 'highest'
- php-version: '8.1'
dependency-versions: 'highest'
- php-version: '8.0'
dependency-versions: 'highest'
steps:
- uses: actions/checkout@v3

# - name: Validate composer.json and composer.lock
# run: composer validate --strict

- name: "Install PHP"
uses: shivammathur/setup-php@v2
with:
coverage: "xdebug"
php-version: "${{ matrix.php-version }}"
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
Expand All @@ -29,8 +49,11 @@ jobs:
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: "Composer install"
uses: "ramsey/composer-install@v2"
with:
dependency-versions: "${{ matrix.dependency-versions }}"
composer-options: "--prefer-dist --no-cache --no-progress"

# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
# Docs: https://getcomposer.org/doc/articles/scripts.md
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@
"ergebnis/composer-normalize": "^2.29",
"friendsofphp/php-cs-fixer": "^3.13",
"phpstan/phpstan": "^1.9",
"phpunit/php-code-coverage": "^9.2",
"phpunit/phpunit": "^9.5",
"phpunit/php-code-coverage": "^9",
"phpunit/phpunit": "^9.6",
"symfony/expression-language": "^5.4 || ^6",
"symfony/intl": "^5.4 || ^6",
"symfony/var-dumper": "^5.4 || ^6",
"vimeo/psalm": "^5.2"
"vimeo/psalm": "^5.5"
},
"suggest": {
"ext-intl": "You need this PHP extension if you will be using `time_zone` alidator with option `intl_compatible`",
Expand Down
6 changes: 3 additions & 3 deletions tests/Unit/libraryTest.php → tests/Unit/LibraryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ public function testSerializeEmpty(): void
$empty = $this->createEmptyDto();
$json = file_get_contents(__DIR__.'/json_empty.json');

$this->testSerialize($empty, $json);
$this->serializeTest($empty, $json);
}

public function testSerializeValid(): void
{
$json = file_get_contents(__DIR__.'/json_valid.json');
$this->testSerialize($this->createValidDto(), $json);
$this->serializeTest($this->createValidDto(), $json);
}

public function testIterableDto(): void
Expand All @@ -113,7 +113,7 @@ public function testIterableDto(): void
$simpleUser[$invalidProperty];
}

protected function testSerialize(AbstractDto $dtoTransfer, string $exceptedJson): void
private function serializeTest(AbstractDto $dtoTransfer, string $exceptedJson): void
{
$serializer = new SerializerFacadeDefault();

Expand Down

0 comments on commit 86fc1ee

Please sign in to comment.