Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
arogachev committed Nov 18, 2024
1 parent 5406fe1 commit 026bcf5
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ jobs:

- name: Run tests with phpunit with code coverage.
run: vendor/bin/phpunit --coverage-clover=coverage.xml --colors=always
env:
YII_ORACLE_SID: XE
YII_ORACLE_HOST: localhost
YII_ORACLE_PORT: 1521
YII_ORACLE_USER: system
YII_ORACLE_PASSWORD: root

- name: Upload coverage to Codecov.
uses: codecov/codecov-action@v3
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/mutation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,8 @@ jobs:
vendor/bin/roave-infection-static-analysis-plugin --threads=2 --ignore-msi-with-no-mutations --only-covered
env:
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
YII_ORACLE_SID: XE
YII_ORACLE_HOST: localhost
YII_ORACLE_PORT: 1521
YII_ORACLE_USER: system
YII_ORACLE_PASSWORD: root
4 changes: 2 additions & 2 deletions tests/.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ENVIRONMENT=local
YII_ORACLE_DATABASE=
YII_ORACLE_SID=XE
YII_ORACLE_HOST=oracle
YII_ORACLE_PORT=
YII_ORACLE_PORT=1521
YII_ORACLE_USER=system
YII_ORACLE_PASSWORD=root
10 changes: 5 additions & 5 deletions tests/Support/TestTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ protected static function getDb(): PdoConnectionInterface
{
$dsn = (new Dsn(
host: self::getHost(),
databaseName: self::getDatabaseName(),
databaseName: self::getSid(),
port: self::getPort(),
options: ['charset' => 'AL32UTF8'],
))->asString();
Expand All @@ -49,7 +49,7 @@ protected function getDsn(): string
if ($this->dsn === '') {
$this->dsn = (new Dsn(
host: self::getHost(),
databaseName: self::getDatabaseName(),
databaseName: self::getSid(),
port: self::getPort(),
options: ['charset' => 'AL32UTF8'],
))->asString();
Expand All @@ -73,9 +73,9 @@ private function getDriver(): PdoDriverInterface
return new Driver($this->getDsn(), self::getUsername(), self::getPassword());
}

private static function getDatabaseName(): string
private static function getSid(): string
{
return getenv('YII_ORACLE_DATABASE') ?: 'XE';
return getenv('YII_ORACLE_SID');
}

private static function getHost(): string
Expand All @@ -85,7 +85,7 @@ private static function getHost(): string

private static function getPort(): string
{
return getenv('YII_ORACLE_PORT') ?: '1521';
return getenv('YII_ORACLE_PORT');
}

private static function getUsername(): string
Expand Down

0 comments on commit 026bcf5

Please sign in to comment.