-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IBX-6824: Added ability to perform queries across multiple tables
- Loading branch information
Showing
19 changed files
with
761 additions
and
111 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 |
---|---|---|
|
@@ -68,3 +68,107 @@ jobs: | |
|
||
- name: Run test suite | ||
run: composer run-script --timeout=600 test | ||
|
||
integration-tests-postgres: | ||
name: PostgreSQL integration tests | ||
needs: tests | ||
services: | ||
postgres: | ||
image: postgres:11 | ||
ports: | ||
- 5432 | ||
env: | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: testdb | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
--tmpfs /var/lib/postgresql/data | ||
runs-on: "ubuntu-22.04" | ||
timeout-minutes: 20 | ||
|
||
strategy: | ||
matrix: | ||
php: | ||
- '7.4' | ||
- '8.0' | ||
- '8.2' | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup PHP Action | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
coverage: none | ||
extensions: pdo_pgsql, gd | ||
tools: cs2pr | ||
|
||
- uses: ramsey/composer-install@v2 | ||
with: | ||
dependency-versions: highest | ||
|
||
- name: Setup problem matchers for PHPUnit | ||
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | ||
|
||
- name: Run integration test suite on Postgres | ||
run: composer run-script --timeout=600 test-integration | ||
env: | ||
SEARCH_ENGINE: legacy | ||
DATABASE_URL: "pgsql://postgres:postgres@localhost:${{ job.services.postgres.ports[5432] }}/testdb?server_version=10" | ||
|
||
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-22.04" | ||
timeout-minutes: 20 | ||
|
||
strategy: | ||
matrix: | ||
php: | ||
- '7.4' | ||
- '8.0' | ||
- '8.2' | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- 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@v2 | ||
with: | ||
dependency-versions: highest | ||
|
||
- 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 --timeout=600 test-integration | ||
env: | ||
SEARCH_ENGINE: legacy | ||
DATABASE_URL: "mysql://mysql:[email protected]:${{ job.services.mysql.ports[3306] }}/testdb" |
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
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 @@ | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd" | ||
bootstrap="tests/integration/bootstrap.php" | ||
beStrictAboutOutputDuringTests="true" | ||
beStrictAboutTodoAnnotatedTests="true" | ||
failOnWarning="true" | ||
verbose="true"> | ||
<php> | ||
<env name="KERNEL_CLASS" value="Ibexa\Tests\Integration\CorePersistence\Kernel" /> | ||
<env name="SEARCH_ENGINE" value="legacy" /> | ||
<env name="DATABASE_URL" value="sqlite://i@i/var/test.db" /> | ||
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0&max[direct]=0&verbose=0"/> | ||
</php> | ||
<testsuites> | ||
<testsuite name="integration"> | ||
<directory>tests/integration</directory> | ||
</testsuite> | ||
</testsuites> | ||
<extensions> | ||
<extension class="DAMA\DoctrineTestBundle\PHPUnit\PHPUnitExtension" /> | ||
</extensions> | ||
<listeners> | ||
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener"/> | ||
</listeners> | ||
</phpunit> |
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
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
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,44 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Copyright (C) Ibexa AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Ibexa\Contracts\CorePersistence\Gateway; | ||
|
||
abstract class AbstractDoctrineRelationship implements DoctrineRelationshipInterface | ||
{ | ||
/** @var class-string */ | ||
protected string $relationshipClass; | ||
|
||
/** @var non-empty-string */ | ||
protected string $foreignProperty; | ||
|
||
/** @var non-empty-string */ | ||
protected string $foreignKeyColumn; | ||
|
||
/** @var non-empty-string */ | ||
protected string $relatedClassIdColumn; | ||
|
||
public function getRelationshipClass(): string | ||
{ | ||
return $this->relationshipClass; | ||
} | ||
|
||
public function getRelatedClassIdColumn(): string | ||
{ | ||
return $this->relatedClassIdColumn; | ||
} | ||
|
||
public function getForeignProperty(): string | ||
{ | ||
return $this->foreignProperty; | ||
} | ||
|
||
public function getForeignKeyColumn(): string | ||
{ | ||
return $this->foreignKeyColumn; | ||
} | ||
} |
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
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
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
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
Oops, something went wrong.