Skip to content

Commit 52fc238

Browse files
committed
add test
Signed-off-by: Matthew Peveler <matt.peveler@gmail.com>
1 parent e3a8b12 commit 52fc238

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

tests/Phinx/Db/Adapter/SqlServerAdapterTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,22 @@ public function testChangeColumnDefaultToZero()
681681
$this->assertSame(0, $columns['column1']->getDefault());
682682
}
683683

684+
public function testChangeColumnDefaultStringBoolean(): void
685+
{
686+
$table = new Table('t', [], $this->adapter);
687+
$table->addColumn('column1', 'boolean', ['default' => 'true'])
688+
->save();
689+
$columns = $this->adapter->getColumns('t');
690+
$this->assertSame(1, $columns['column1']->getDefault());
691+
$newColumn1 = new Column();
692+
$newColumn1
693+
->setType('boolean')
694+
->setDefault('false');
695+
$table->changeColumn('column1', $newColumn1)->save();
696+
$columns = $this->adapter->getColumns('t');
697+
$this->assertSame(0, $columns['column1']->getDefault());
698+
}
699+
684700
public function testDropColumn()
685701
{
686702
$table = new Table('t', [], $this->adapter);

0 commit comments

Comments
 (0)