Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
"vimeo/psalm": "^5.26.1 || ^6.8.8",
"vlucas/phpdotenv": "^5.6.1",
"yiisoft/aliases": "^2.0",
"yiisoft/cache-file": "^3.2",
"yiisoft/psr-dummy-provider": "^1.0",
"yiisoft/test-support": "^3.0",
"yiisoft/var-dumper": "^1.7"
},
"provide": {
Expand Down
6 changes: 2 additions & 4 deletions tests/BatchQueryResultTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@

namespace Yiisoft\Db\Oracle\Tests;

use Yiisoft\Db\Oracle\Tests\Support\TestTrait;
use Yiisoft\Db\Oracle\Tests\Support\IntegrationTestTrait;
use Yiisoft\Db\Tests\Common\CommonBatchQueryResultTest;

/**
* @group oracle
*
* @psalm-suppress PropertyNotSetInConstructor
*/
final class BatchQueryResultTest extends CommonBatchQueryResultTest
{
use TestTrait;
use IntegrationTestTrait;
}
8 changes: 4 additions & 4 deletions tests/ColumnBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@

use PHPUnit\Framework\Attributes\DataProviderExternal;
use Yiisoft\Db\Oracle\Tests\Provider\ColumnBuilderProvider;
use Yiisoft\Db\Oracle\Tests\Support\TestTrait;
use Yiisoft\Db\Tests\AbstractColumnBuilderTest;
use Yiisoft\Db\Oracle\Tests\Support\IntegrationTestTrait;
use Yiisoft\Db\Tests\Common\CommonColumnBuilderTest;

/**
* @group oracle
*/
class ColumnBuilderTest extends AbstractColumnBuilderTest
class ColumnBuilderTest extends CommonColumnBuilderTest
{
use TestTrait;
use IntegrationTestTrait;

#[DataProviderExternal(ColumnBuilderProvider::class, 'buildingMethods')]
public function testBuildingMethods(
Expand Down
10 changes: 5 additions & 5 deletions tests/ColumnDefinitionParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@

namespace Yiisoft\Db\Oracle\Tests;

use PHPUnit\Framework\Attributes\DataProviderExternal;
use Yiisoft\Db\Oracle\Column\ColumnDefinitionParser;
use Yiisoft\Db\Tests\AbstractColumnDefinitionParserTest;
use Yiisoft\Db\Oracle\Tests\Provider\ColumnDefinitionParserProvider;
use Yiisoft\Db\Tests\Common\CommonColumnDefinitionParserTest;

/**
* @group oracle
*/
final class ColumnDefinitionParserTest extends AbstractColumnDefinitionParserTest
final class ColumnDefinitionParserTest extends CommonColumnDefinitionParserTest
{
/**
* @dataProvider \Yiisoft\Db\Oracle\Tests\Provider\ColumnDefinitionParserProvider::parse
*/
#[DataProviderExternal(ColumnDefinitionParserProvider::class, 'parse')]
public function testParse(string $definition, array $expected): void
{
parent::testParse($definition, $expected);
Expand Down
8 changes: 4 additions & 4 deletions tests/ColumnFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
use PHPUnit\Framework\Attributes\DataProviderExternal;
use Yiisoft\Db\Oracle\Column\ColumnFactory;
use Yiisoft\Db\Oracle\Tests\Provider\ColumnFactoryProvider;
use Yiisoft\Db\Oracle\Tests\Support\TestTrait;
use Yiisoft\Db\Oracle\Tests\Support\IntegrationTestTrait;
use Yiisoft\Db\Schema\Column\ColumnInterface;
use Yiisoft\Db\Tests\AbstractColumnFactoryTest;
use Yiisoft\Db\Tests\Common\CommonColumnFactoryTest;

/**
* @group oracle
*/
final class ColumnFactoryTest extends AbstractColumnFactoryTest
final class ColumnFactoryTest extends CommonColumnFactoryTest
{
use TestTrait;
use IntegrationTestTrait;

#[DataProviderExternal(ColumnFactoryProvider::class, 'dbTypes')]
public function testFromDbType(string $dbType, string $expectedType, string $expectedInstanceOf): void
Expand Down
59 changes: 21 additions & 38 deletions tests/ColumnTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
use Yiisoft\Db\Oracle\Column\ColumnBuilder;
use Yiisoft\Db\Oracle\Column\JsonColumn;
use Yiisoft\Db\Oracle\Tests\Provider\ColumnProvider;
use Yiisoft\Db\Oracle\Tests\Support\TestTrait;
use Yiisoft\Db\Oracle\Tests\Support\Fixture\FixtureDump;
use Yiisoft\Db\Oracle\Tests\Support\IntegrationTestTrait;
use Yiisoft\Db\Oracle\Tests\Support\TestConnection;
use Yiisoft\Db\Query\Query;
use Yiisoft\Db\Schema\Column\ColumnInterface;
use Yiisoft\Db\Schema\Column\DoubleColumn;
Expand All @@ -33,21 +35,14 @@
*/
final class ColumnTest extends CommonColumnTest
{
use TestTrait;
use IntegrationTestTrait;

public function testQueryWithTypecasting(): void
{
$db = $this->getConnection();
$version = $db->getServerInfo()->getVersion();
$db->close();

$isOldVersion = version_compare($version, '21', '<');

if (!$isOldVersion) {
$this->fixture = 'oci21.sql';
}
$db = $this->getSharedConnection();
$isOldVersion = version_compare(TestConnection::getServerVersion(), '21', '<');

$db = $this->getConnection(true);
$this->loadFixture($isOldVersion ? FixtureDump::DEFAULT : FixtureDump::OCI21);

$this->insertTypeValues($db);

Expand All @@ -66,17 +61,10 @@ public function testQueryWithTypecasting(): void

public function testCommandWithPhpTypecasting(): void
{
$db = $this->getConnection();
$version = $db->getServerInfo()->getVersion();
$db->close();

$isOldVersion = version_compare($version, '21', '<');

if (!$isOldVersion) {
$this->fixture = 'oci21.sql';
}
$db = $this->getSharedConnection();
$isOldVersion = version_compare(TestConnection::getServerVersion(), '21', '<');

$db = $this->getConnection(true);
$this->loadFixture($isOldVersion ? FixtureDump::DEFAULT : FixtureDump::OCI21);

$this->insertTypeValues($db);

Expand All @@ -95,7 +83,7 @@ public function testCommandWithPhpTypecasting(): void

public function testSelectWithPhpTypecasting(): void
{
$db = $this->getConnection();
$db = $this->getSharedConnection();

$sql = "SELECT null, 1, 2.5, 'string' FROM DUAL";

Expand Down Expand Up @@ -141,27 +129,20 @@ public function testSelectWithPhpTypecasting(): void

public function testPhpTypecast(): void
{
$db = $this->getConnection();
$version = $db->getServerInfo()->getVersion();
$db->close();
$db = $this->getSharedConnection();
$isOldVersion = version_compare(TestConnection::getServerVersion(), '21', '<');

if (version_compare($version, '21', '>=')) {
$this->fixture = 'oci21.sql';
}
$this->loadFixture($isOldVersion ? FixtureDump::DEFAULT : FixtureDump::OCI21);

parent::testPhpTypecast();
}

public function testColumnInstance(): void
{
$db = $this->getConnection();
$db = $this->getSharedConnection();
$isOldVersion = version_compare(TestConnection::getServerVersion(), '21', '<');

if (version_compare($db->getServerInfo()->getVersion(), '21', '>=')) {
$this->fixture = 'oci21.sql';
}

$db->close();
$db = $this->getConnection(true);
$this->loadFixture($isOldVersion ? FixtureDump::DEFAULT : FixtureDump::OCI21);

$schema = $db->getSchema();
$tableSchema = $schema->getTableSchema('type');
Expand Down Expand Up @@ -221,7 +202,9 @@ public function testJsonColumn(): void

public function testUniqueColumn(): void
{
$db = $this->getConnection(true);
$db = $this->getSharedConnection();
$this->loadFixture();

$schema = $db->getSchema();

$this->assertTrue($schema->getTableSchema('T_constraints_1')?->getColumn('C_unique')->isUnique());
Expand All @@ -233,7 +216,7 @@ public function testUniqueColumn(): void

public function testTimestampColumnOnDifferentTimezones(): void
{
$db = $this->getConnection();
$db = $this->createConnection();
$schema = $db->getSchema();
$command = $db->createCommand();
$tableName = 'timestamp_column_test';
Expand Down
Loading
Loading