Skip to content

Commit

Permalink
Column: added hasOption()
Browse files Browse the repository at this point in the history
  • Loading branch information
janpecha committed Dec 5, 2018
1 parent 1a9fb27 commit 810b281
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Column.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,15 @@ public function getOptions()
}


/**
* @return array
*/
public function hasOption($name)
{
return array_key_exists($name, $this->options);
}


/**
* @param bool
* @return self
Expand Down
2 changes: 2 additions & 0 deletions tests/SqlSchema/Column.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ test(function () {
Assert::same(array(), $column->getParameters());
Assert::null($column->getComment());
Assert::null($column->getDefaultValue());
Assert::false($column->hasOption('UNSIGNED'));
});


Expand Down Expand Up @@ -47,4 +48,5 @@ test(function () {
Assert::same(array(11), $column->getParameters());
Assert::same('column comment', $column->getComment());
Assert::same(123, $column->getDefaultValue());
Assert::true($column->hasOption('UNSIGNED'));
});

0 comments on commit 810b281

Please sign in to comment.