Skip to content

Commit

Permalink
Set default connection settings for tests (#304)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigrov authored Feb 23, 2025
1 parent 04fedd1 commit 0e065ae
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 19 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,6 @@ 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_DATABASE: YIITEST
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
6 changes: 0 additions & 6 deletions .github/workflows/mutation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,3 @@ 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_DATABASE: YIITEST
YII_ORACLE_HOST: localhost
YII_ORACLE_PORT: 1521
YII_ORACLE_USER: system
YII_ORACLE_PASSWORD: root
12 changes: 6 additions & 6 deletions tests/Support/TestTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,31 +75,31 @@ private function getDriver(): PdoDriverInterface

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

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

private static function getHost(): string
{
return getenv('YII_ORACLE_HOST') ?? '';
return getenv('YII_ORACLE_HOST') ?: 'localhost';
}

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

private static function getUsername(): string
{
return getenv('YII_ORACLE_USER') ?? '';
return getenv('YII_ORACLE_USER') ?: 'system';
}

private static function getPassword(): string
{
return getenv('YII_ORACLE_PASSWORD') ?? '';
return getenv('YII_ORACLE_PASSWORD') ?: 'root';
}
}

0 comments on commit 0e065ae

Please sign in to comment.