Skip to content

Commit

Permalink
Merge pull request #4 from netlogix/feature/flow-8
Browse files Browse the repository at this point in the history
  • Loading branch information
paxuclus committed Feb 14, 2024
2 parents 56830df + 246f538 commit 6a15a80
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 17 deletions.
33 changes: 25 additions & 8 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: [push, pull_request]

jobs:
unittests:
name: '[PHP ${{ matrix.php-versions }} | Flow ${{ matrix.flow-versions }}] Unit Tests'
name: '[PHP ${{ matrix.php-version }} | Flow ${{ matrix.flow-version }}] Unit Tests'
runs-on: ubuntu-latest
# services:
# mariadb:
Expand All @@ -22,8 +22,13 @@ jobs:
strategy:
fail-fast: false
matrix:
php-versions: [7.2, 7.3, 7.4]
flow-versions: [5.3, 6.3]
php-version: [7.4, 8.2]
flow-version: [7.3, 8.3]

exclude:
# Disable Flow 8.3 on PHP 7, as 8.0 is required
- php-version: 7.4
flow-version: 8.3

env:
FLOW_CONTEXT: Testing/Unit
Expand All @@ -32,20 +37,32 @@ jobs:
steps:
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
php-version: ${{ matrix.php-version }}
extensions: mbstring, xml, json, zlib, iconv, intl, pdo_sqlite, mysql
ini-values: opcache.fast_shutdown=0

- name: Cache composer dependencies
uses: actions/cache@v1
with:
path: ~/.composer/cache
key: php-${{ matrix.php-versions }}-flow-${{ matrix.flow-versions }}-composer-${{ hashFiles('composer.json') }}
key: php-${{ matrix.php-version }}-flow-${{ matrix.flow-version }}-composer-${{ hashFiles('composer.json') }}
restore-keys: |
php-${{ matrix.php-versions }}-flow-${{ matrix.flow-versions }}-composer-
php-${{ matrix.php-versions }}-flow-
php-${{ matrix.php-version }}-flow-${{ matrix.flow-version }}-composer-
php-${{ matrix.php-version }}-flow-
- name: Install composer dependencies
run: composer create-project neos/flow-base-distribution ${{ env.FLOW_DIST_FOLDER }} --prefer-dist --no-progress "^${{ matrix.flow-versions }}"
run: composer create-project neos/flow-base-distribution ${{ env.FLOW_DIST_FOLDER }} --prefer-dist --no-progress --no-install "^${{ matrix.flow-version }}"

- name: Allow neos composer plugin
run: composer config --no-plugins allow-plugins.neos/composer-plugin true
working-directory: ${{ env.FLOW_DIST_FOLDER }}

- name: Require behat in compatible version
run: composer require --dev --no-update "neos/behat:@dev"
working-directory: ${{ env.FLOW_DIST_FOLDER }}

- name: Install project
run: composer install
working-directory: ${{ env.FLOW_DIST_FOLDER }}

- name: Checkout code
uses: actions/checkout@v2
Expand Down
7 changes: 4 additions & 3 deletions Tests/Unit/Domain/Job/ExecuteMigrationJobTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@
use Netlogix\Migrations\Error\UnknownMigration;
use Netlogix\Migrations\JobQueue\Domain\Job\ExecuteMigrationJob;
use Netlogix\Migrations\JobQueue\Domain\Model\AsyncMigration;
use PHPUnit\Framework\MockObject\MockObject;
use RuntimeException;

class ExecuteMigrationJobTest extends UnitTestCase
{

/**
* @var MigrationService|\PHPUnit_Framework_MockObject_MockObject
* @var MigrationService|MockObject
*/
private $migrationService;

Expand Down Expand Up @@ -229,7 +230,7 @@ public function down(): void
$job->initializeObject();
}

public function provideDirections(): Generator
public static function provideDirections(): Generator
{
yield 'UP' => ['up'];
yield 'DOWN' => ['down'];
Expand All @@ -247,7 +248,7 @@ private function executeJob(ExecuteMigrationJob $job): bool
}

/**
* @return AsyncMigration|\PHPUnit_Framework_MockObject_MockObject
* @return AsyncMigration|MockObject
*/
private function setupAsyncMigrationMock()
{
Expand Down
4 changes: 2 additions & 2 deletions Tests/Unit/Domain/Service/AsyncMigrationHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,13 @@ public function If_no_queueName_is_set_an_exception_is_thrown(): void
$handler->injectSettings(['anything' => 'but the queue name']);
}

public function provideDirections(): Generator
public static function provideDirections(): Generator
{
yield 'UP' => ['up'];
yield 'DOWN' => ['down'];
}

public function provideInvalidMigrationClassNames(): \Generator
public static function provideInvalidMigrationClassNames(): \Generator
{
yield DefaultMigration::class => [DefaultMigration::class];
yield Migration::class => [Migration::class];
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"license": ["MIT"],
"type": "neos-package",
"require": {
"php": "^7.2",
"neos/flow": "^5.0 || ^6.0",
"netlogix/migrations": "^1.4",
"flowpack/jobqueue-common": "^3.0"
"php": "^7.4 || ^8.2",
"neos/flow": "^7.3 || ^8.3",
"netlogix/migrations": "^2.0",
"flowpack/jobqueue-common": "^3.3"
},
"autoload": {
"psr-4": {
Expand Down

0 comments on commit 6a15a80

Please sign in to comment.