Skip to content

Commit 53d592a

Browse files
committed
test: add property $table
1 parent 55a2932 commit 53d592a

5 files changed

Lines changed: 11 additions & 10 deletions

File tree

tests/system/Database/Live/AbstractGetFieldDataTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ abstract class AbstractGetFieldDataTest extends CIUnitTestCase
2626
protected $db;
2727

2828
protected Forge $forge;
29+
protected string $table = 'test1';
2930

3031
protected function setUp(): void
3132
{
@@ -46,12 +47,12 @@ protected function tearDown(): void
4647
{
4748
parent::tearDown();
4849

49-
$this->forge->dropTable('test1', true);
50+
$this->forge->dropTable($this->table, true);
5051
}
5152

5253
protected function createTable()
5354
{
54-
$this->forge->dropTable('test1', true);
55+
$this->forge->dropTable($this->table, true);
5556

5657
$this->forge->addField([
5758
'id' => [
@@ -88,7 +89,7 @@ protected function createTable()
8889
],
8990
]);
9091
$this->forge->addKey('id', true);
91-
$this->forge->createTable('test1');
92+
$this->forge->createTable($this->table);
9293
}
9394

9495
abstract public function testGetFieldDataDefault(): void;

tests/system/Database/Live/MySQLi/GetFieldDataTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ private function isOldMySQL(): bool
4848

4949
public function testGetFieldDataDefault(): void
5050
{
51-
$fields = $this->db->getFieldData('test1');
51+
$fields = $this->db->getFieldData($this->table);
5252

5353
$this->assertJsonStringEqualsJsonString(
5454
json_encode([

tests/system/Database/Live/OCI8/GetFieldDataTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ protected function createForge(): void
3434

3535
public function testGetFieldDataDefault(): void
3636
{
37-
$fields = $this->db->getFieldData('test1');
37+
$fields = $this->db->getFieldData($this->table);
3838

3939
$data = [];
4040

tests/system/Database/Live/SQLSRV/GetFieldDataTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ protected function createForge(): void
3434

3535
public function testGetFieldDataDefault(): void
3636
{
37-
$fields = $this->db->getFieldData('test1');
37+
$fields = $this->db->getFieldData($this->table);
3838

3939
$this->assertJsonStringEqualsJsonString(
4040
json_encode([

tests/system/Database/Live/SQLite3/GetFieldDataTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ protected function createForge(): void
3838

3939
public function testGetFieldDataDefault(): void
4040
{
41-
$fields = $this->db->getFieldData('test1');
41+
$fields = $this->db->getFieldData($this->table);
4242

4343
$this->assertJsonStringEqualsJsonString(
4444
json_encode([
@@ -105,7 +105,7 @@ public function testGetFieldDataDefault(): void
105105

106106
protected function createTableCompositePrimaryKey()
107107
{
108-
$this->forge->dropTable('test1', true);
108+
$this->forge->dropTable($this->table, true);
109109

110110
$this->forge->addField([
111111
'pk1' => [
@@ -122,14 +122,14 @@ protected function createTableCompositePrimaryKey()
122122
],
123123
]);
124124
$this->forge->addPrimaryKey(['pk1', 'pk2']);
125-
$this->forge->createTable('test1');
125+
$this->forge->createTable($this->table);
126126
}
127127

128128
public function testGetFieldDataCompositePrimaryKey(): void
129129
{
130130
$this->createTableCompositePrimaryKey();
131131

132-
$fields = $this->db->getFieldData('test1');
132+
$fields = $this->db->getFieldData($this->table);
133133

134134
$this->assertJsonStringEqualsJsonString(
135135
json_encode([

0 commit comments

Comments
 (0)