-
Notifications
You must be signed in to change notification settings - Fork 891
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When setting options as a non-associative array, Column fails with "C…
…all to undefined method Phinx\Db\Table\Column::set0()". This check makes sure the developer gets an appropriate message. Using strict in_array() to check for non-assoc arrays
- Loading branch information
Showing
6 changed files
with
50 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace Test\Phinx\Db\Table; | ||
|
||
use Phinx\Db\Table\Column; | ||
|
||
class ColumnTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* @expectedException \RuntimeException | ||
* @expectedExceptionMessage "0" is not a valid column option. | ||
*/ | ||
public function testSetOptionThrowsExceptionIfOptionIsNotString() | ||
{ | ||
$column = new Column(); | ||
$column->setOptions(['identity']); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace Test\Phinx\Db\Table; | ||
|
||
use Phinx\Db\Table\Index; | ||
|
||
class IndexTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* @expectedException \RuntimeException | ||
* @expectedExceptionMessage "0" is not a valid index option. | ||
*/ | ||
public function testSetOptionThrowsExceptionIfOptionIsNotString() | ||
{ | ||
$column = new Index(); | ||
$column->setOptions(['type']); | ||
} | ||
} |