Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
arogachev committed Dec 2, 2024
1 parent 2f68a80 commit a63ce24
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 18 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
ports:
- 1521:1521
env:
ORACLE_DATABASE : yiitest
ORACLE_DATABASE: FREEPDB1
ORACLE_PASSWORD : root
options: >-
--name=oci
Expand Down Expand Up @@ -97,6 +97,7 @@ jobs:
run: vendor/bin/phpunit --coverage-clover=coverage.xml --colors=always
env:
YII_ORACLE_SID: XE
YII_ORACLE_DATABASE: FREEPDB1
YII_ORACLE_HOST: localhost
YII_ORACLE_PORT: 1521
YII_ORACLE_USER: system
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/mutation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
ports:
- 1521:1521
env:
ORACLE_DATABASE : yiitest
ORACLE_DATABASE: FREEPDB1
ORACLE_PASSWORD : root
options: >-
--name=oci
Expand Down Expand Up @@ -85,6 +85,7 @@ jobs:
env:
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
YII_ORACLE_SID: XE
YII_ORACLE_DATABASE: FREEPDB1
YII_ORACLE_HOST: localhost
YII_ORACLE_PORT: 1521
YII_ORACLE_USER: system
Expand Down
12 changes: 1 addition & 11 deletions tests/CommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,10 @@
use Yiisoft\Db\Exception\InvalidCallException;
use Yiisoft\Db\Exception\InvalidConfigException;
use Yiisoft\Db\Exception\NotSupportedException;
use Yiisoft\Db\Oracle\Connection;
use Yiisoft\Db\Oracle\Dsn;
use Yiisoft\Db\Oracle\Driver;
use Yiisoft\Db\Oracle\Tests\Support\TestTrait;
use Yiisoft\Db\Query\Query;
use Yiisoft\Db\Tests\Common\CommonCommandTest;
use Yiisoft\Db\Tests\Support\Assert;
use Yiisoft\Db\Tests\Support\DbHelper;
use Yiisoft\Db\Transaction\TransactionInterface;

use function is_resource;
Expand Down Expand Up @@ -628,12 +624,6 @@ public function testProfilerData(string $sql = null): void

public function testShowDatabases(): void
{
$dsn = new Dsn('oci', 'localhost');
$db = new Connection(new Driver($dsn->asString(), 'SYSTEM', 'root'), DbHelper::getSchemaCache());

$command = $db->createCommand();

$this->assertSame('oci:dbname=localhost:1521', $db->getDriver()->getDsn());
$this->assertSame(['YIITEST'], $command->showDatabases());
$this->assertSame([self::getDatabaseName()], self::getDb()->createCommand()->showDatabases());
}
}
15 changes: 10 additions & 5 deletions tests/Support/TestTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,26 +75,31 @@ private function getDriver(): PdoDriverInterface

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

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

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

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

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

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

0 comments on commit a63ce24

Please sign in to comment.