Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigrov committed Feb 3, 2024
1 parent 692880c commit 472fbd4
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion tests/QueryBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,6 @@ public function testInsertInteger()
public function testRenameColumn(): void
{
$db = $this->getConnection();

$qb = $db->getQueryBuilder();

$this->assertSame(
Expand All @@ -525,6 +524,20 @@ public function testRenameColumn(): void
SQL,
$qb->renameColumn('alpha', 'string_identifier', 'string_identifier_test'),
);

$this->assertSame(
<<<SQL
ALTER TABLE `alpha` CHANGE `non_exist_column` `new_column`
SQL,
$qb->renameColumn('alpha', 'non_exist_column', 'new_column'),
);

$this->assertSame(
<<<SQL
ALTER TABLE `non_exist_table` CHANGE `non_exist_column` `new_column`
SQL,
$qb->renameColumn('non_exist_table', 'non_exist_column', 'new_column'),
);
}

/**
Expand Down

0 comments on commit 472fbd4

Please sign in to comment.