Skip to content

Commit 4eb8e3c

Browse files
committed
Reverted tests to commit 15fb93d
1 parent 86d3d3f commit 4eb8e3c

File tree

2 files changed

+4
-22
lines changed

2 files changed

+4
-22
lines changed

tests/config/db.config.php.dist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?php
22
return [
33
'db' => [
4-
'mockDb2UsingSqlite' => false,
54
'odbc' => [
65
'dsn' => 'DSN=*LOCAL;',
76
'username' => 'MYUSER',

tests/functional/ToolkitTest.php

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,10 @@ final class ToolkitTest extends TestCase
2121
*/
2222
private $toolkitOptions;
2323

24-
/**
25-
* @var bool
26-
*/
27-
private $mockDb2UsingSqlite;
28-
2924
public function setUp(): void
3025
{
3126
$config = getConfig();
3227

33-
$this->mockDb2UsingSqlite = $config['db']['mockDb2UsingSqlite'] ?? false;
3428
$this->connectionOptions = $config['db']['odbc'];
3529
$this->toolkitOptions = $config['toolkit'];
3630
}
@@ -41,7 +35,7 @@ public function setUp(): void
4135
public function testCanPassPdoOdbcObjectToToolkit()
4236
{
4337
$pdo = new \PDO(
44-
$this->buildDsn('pdo'),
38+
'odbc:' . $this->connectionOptions['dsn'],
4539
$this->connectionOptions['username'],
4640
$this->connectionOptions['password'],
4741
[
@@ -50,7 +44,7 @@ public function testCanPassPdoOdbcObjectToToolkit()
5044
'quote_identifiers' => $this->connectionOptions['platform_options']['quote_identifiers'],
5145
]
5246
]
53-
);
47+
);
5448

5549
$toolkit = new Toolkit($pdo, null, null, 'pdo');
5650
$toolkit->setOptions($this->toolkitOptions);
@@ -63,7 +57,7 @@ public function testCanPassPdoOdbcObjectToToolkit()
6357
*/
6458
public function testCanPassOdbcResourceToToolkit()
6559
{
66-
$connection = odbc_connect($this->buildDsn('odbc'), $this->connectionOptions['username'], $this->connectionOptions['password']);
60+
$connection = odbc_connect($this->connectionOptions['dsn'], $this->connectionOptions['username'], $this->connectionOptions['password']);
6761

6862
if (!$connection) {
6963
throw new \Exception('Connection failed');
@@ -80,7 +74,7 @@ public function testCanPassOdbcResourceToToolkit()
8074
public function testCanPassOdbcConnectionParametersToToolkit()
8175
{
8276
$toolkit = new Toolkit(
83-
$this->buildDsn('odbc'),
77+
$this->connectionOptions['dsn'],
8478
$this->connectionOptions['username'],
8579
$this->connectionOptions['password'],
8680
'odbc'
@@ -89,15 +83,4 @@ public function testCanPassOdbcConnectionParametersToToolkit()
8983

9084
$this->assertInstanceOf(Toolkit::class, $toolkit);
9185
}
92-
93-
/**
94-
* Builds the appropriate DSN based on configuration.
95-
*/
96-
private function buildDsn(string $type = 'pdo'): string
97-
{
98-
if ($this->mockDb2UsingSqlite) {
99-
return ($type === 'pdo') ? 'sqlite::memory:' : 'Driver=SQLite3;Database=:memory:';
100-
}
101-
return ($type === 'pdo') ? 'odbc:' . $this->connectionOptions['dsn'] : $this->connectionOptions['dsn'];
102-
}
10386
}

0 commit comments

Comments
 (0)