Skip to content

Commit

Permalink
Added GridTest
Browse files Browse the repository at this point in the history
  • Loading branch information
DonCallisto committed Jun 24, 2017
1 parent 0061585 commit 25fc870
Show file tree
Hide file tree
Showing 3 changed files with 4,657 additions and 60 deletions.
7 changes: 5 additions & 2 deletions Grid/Columns.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

namespace APY\DataGridBundle\Grid;

use APY\DataGridBundle\Grid\Column\ActionsColumn;
use APY\DataGridBundle\Grid\Column\Column;
use APY\DataGridBundle\Grid\Helper\ColumnsIterator;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
Expand All @@ -21,6 +22,8 @@ class Columns implements \IteratorAggregate, \Countable
protected $columns = [];
protected $extensions = [];

const MISSING_COLUMN_EX_MSG = 'Column with id "%s" doesn\'t exists';

/**
* @var AuthorizationCheckerInterface
*/
Expand Down Expand Up @@ -83,7 +86,7 @@ public function addColumn(Column $column, $position = 0)
public function getColumnById($columnId)
{
if (($column = $this->hasColumnById($columnId, true)) === false) {
throw new \InvalidArgumentException(sprintf('Column with id "%s" doesn\'t exists', $columnId));
throw new \InvalidArgumentException(sprintf(self::MISSING_COLUMN_EX_MSG, $columnId));
}

return $column;
Expand All @@ -93,7 +96,7 @@ public function getColumnById($columnId)
* @param $columnId
* @param bool $returnColumn
*
* @return bool|Column
* @return bool|Column|ActionsColumn
*/
public function hasColumnById($columnId, $returnColumn = false)
{
Expand Down

0 comments on commit 25fc870

Please sign in to comment.