-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IBX-1489: Provided integration test for Installers for PHP8
- Loading branch information
Showing
4 changed files
with
129 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,9 @@ jobs: | |
- '7.3' | ||
- '7.4' | ||
composer_options: [ "" ] | ||
include: | ||
- php: '8.0' | ||
composer_options: "--ignore-platform-req php" | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
@@ -82,6 +85,9 @@ jobs: | |
- '7.3' | ||
- '7.4' | ||
composer_options: [ "" ] | ||
include: | ||
- php: '8.0' | ||
composer_options: "--ignore-platform-req php" | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
@@ -108,3 +114,60 @@ jobs: | |
DATABASE_URL: "pgsql://postgres:postgres@localhost:${{ job.services.postgres.ports[5432] }}/testdb?server_version=10" | ||
# Required by old repository tests | ||
DATABASE: "pgsql://postgres:postgres@localhost:${{ job.services.postgres.ports[5432] }}/testdb" | ||
|
||
integration-tests-mysql: | ||
name: MySQL integration tests | ||
needs: tests | ||
services: | ||
mysql: | ||
image: mysql:8.0 | ||
ports: | ||
- 3306/tcp | ||
env: | ||
MYSQL_RANDOM_ROOT_PASSWORD: true | ||
MYSQL_USER: mysql | ||
MYSQL_PASSWORD: mysql | ||
MYSQL_DATABASE: testdb | ||
options: >- | ||
--health-cmd="mysqladmin ping" | ||
--health-interval=10s | ||
--health-timeout=5s | ||
--health-retries=5 | ||
--tmpfs=/var/lib/mysql | ||
runs-on: "ubuntu-20.04" | ||
timeout-minutes: 20 | ||
|
||
strategy: | ||
matrix: | ||
php: | ||
- '7.3' | ||
- '7.4' | ||
composer_options: [ "" ] | ||
include: | ||
- php: '8.0' | ||
composer_options: "--ignore-platform-req php" | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup PHP Action | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
coverage: none | ||
extensions: pdo_mysql, gd | ||
tools: cs2pr | ||
|
||
- uses: "ramsey/composer-install@v1" | ||
with: | ||
dependency-versions: "highest" | ||
composer-options: "${{ matrix.composer_options }}" | ||
|
||
- name: Setup problem matchers for PHPUnit | ||
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | ||
|
||
- name: Run integration test suite vs MySQL | ||
run: composer run-script integration | ||
env: | ||
DATABASE_URL: "mysql://mysql:[email protected]:${{ job.services.mysql.ports[3306] }}/testdb" | ||
DATABASE: "mysql://mysql:[email protected]:${{ job.services.mysql.ports[3306] }}/testdb" |
25 changes: 25 additions & 0 deletions
25
tests/integration/Installer/Installer/CoreInstallerTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
namespace Ibexa\Tests\Integration\Installer\Installer; | ||
|
||
use EzSystems\PlatformInstallerBundle\Installer\CoreInstaller; | ||
use Ibexa\Tests\Integration\Installer\TestCase; | ||
use Symfony\Component\Console\Output\NullOutput; | ||
|
||
final class CoreInstallerTest extends TestCase | ||
{ | ||
/** @var \EzSystems\PlatformInstallerBundle\Installer\CoreInstaller */ | ||
private $installer; | ||
|
||
protected function setUp(): void | ||
{ | ||
self::bootKernel(); | ||
$this->installer = self::getServiceByClassName(CoreInstaller::class); | ||
} | ||
|
||
public function testImportSchema(): void | ||
{ | ||
$this->installer->setOutput(new NullOutput()); | ||
$this->installer->importSchema(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Ibexa\Tests\Integration\Installer; | ||
|
||
use Ibexa\Contracts\Core\Test\IbexaKernelTestCase; | ||
|
||
abstract class TestCase extends IbexaKernelTestCase | ||
{ | ||
protected static function getKernelClass(): string | ||
{ | ||
return TestKernel::class; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Ibexa\Tests\Integration\Installer; | ||
|
||
use EzSystems\DoctrineSchemaBundle\DoctrineSchemaBundle; | ||
use EzSystems\PlatformInstallerBundle\EzSystemsPlatformInstallerBundle; | ||
use EzSystems\PlatformInstallerBundle\Installer\CoreInstaller; | ||
use Ibexa\Contracts\Core\Test\IbexaTestKernel; | ||
|
||
final class TestKernel extends IbexaTestKernel | ||
{ | ||
public function registerBundles(): iterable | ||
{ | ||
yield from parent::registerBundles(); | ||
|
||
yield new DoctrineSchemaBundle(); | ||
yield new EzSystemsPlatformInstallerBundle(); | ||
} | ||
|
||
protected static function getExposedServicesByClass(): iterable | ||
{ | ||
yield from parent::getExposedServicesByClass(); | ||
|
||
yield CoreInstaller::class; | ||
} | ||
} |