Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
michalsn committed Oct 29, 2024
1 parent 8940fb3 commit cd11139
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions tests/system/Database/Live/ForgeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1615,9 +1615,15 @@ public function testDropKey(): void
public function testAddTextColumnWithConstraint(): void
{
// some DBMS do not allow a constraint for type TEXT
$this->forge->addColumn('user', [
'text_with_constraint' => ['type' => 'text', 'constraint' => 255, 'default' => ''],
]);
if ($this->db->DBDriver === 'SQLSRV') {
$this->forge->addColumn('user', [
'text_with_constraint' => ['type' => 'nvarchar(max)', 'default' => ''],
]);
} else {
$this->forge->addColumn('user', [
'text_with_constraint' => ['type' => 'text', 'constraint' => 255, 'default' => ''],
]);
}

$this->assertTrue($this->db->fieldExists('text_with_constraint', 'user'));

Expand Down
2 changes: 1 addition & 1 deletion tests/system/Database/Live/GetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public function testGetFieldData(): void
$this->assertSame('int', $typeTest[0]->type_name); // INTEGER AUTOINC
$this->assertSame('varchar', $typeTest[1]->type_name); // VARCHAR
$this->assertSame('char', $typeTest[2]->type_name); // CHAR
$this->assertSame('text', $typeTest[3]->type_name); // TEXT
$this->assertSame('nvarchar', $typeTest[3]->type_name); // TEXT
$this->assertSame('smallint', $typeTest[4]->type_name); // SMALLINT
$this->assertSame('int', $typeTest[5]->type_name); // INTEGER
$this->assertSame('float', $typeTest[6]->type_name); // FLOAT
Expand Down

0 comments on commit cd11139

Please sign in to comment.