Skip to content

Commit 36160ca

Browse files
committed
[2323] add tests for column
1 parent 0ef7884 commit 36160ca

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

tests/Phinx/Db/Table/ColumnTest.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
namespace Test\Phinx\Db\Table;
55

66
use Phinx\Config\FeatureFlags;
7+
use Phinx\Db\Adapter\MysqlAdapter;
78
use Phinx\Db\Table\Column;
89
use PHPUnit\Framework\TestCase;
910
use RuntimeException;
@@ -50,4 +51,22 @@ public function testColumnNullFeatureFlag()
5051
$column = new Column();
5152
$this->assertFalse($column->isNull());
5253
}
54+
55+
public function testSetAlgorithm(): void
56+
{
57+
$column = new Column();
58+
$this->assertNull($column->getAlgorithm());
59+
60+
$column->setOptions(['algorithm' => MysqlAdapter::ALGORITHM_INPLACE]);
61+
$this->assertSame(MysqlAdapter::ALGORITHM_INPLACE, $column->getAlgorithm());
62+
}
63+
64+
public function testSetLock(): void
65+
{
66+
$column = new Column();
67+
$this->assertNull($column->getLock());
68+
69+
$column->setOptions(['lock' => MysqlAdapter::LOCK_NONE]);
70+
$this->assertSame(MysqlAdapter::LOCK_NONE, $column->getLock());
71+
}
5372
}

0 commit comments

Comments
 (0)