setList() public method

Set the list
public setList ( array $list ) : self
$list array The list itself
return self
Example #1
0
 /**
  * @covers Imbo\Model\ListModel::setList
  * @covers Imbo\Model\ListModel::getList
  */
 public function testCanSetAndGetAList()
 {
     $this->assertSame(array(), $this->model->getList());
     $list = array(1, 2, 3);
     $this->assertSame($this->model, $this->model->setList($list));
     $this->assertSame($list, $this->model->getList());
 }
Example #2
0
 /**
  * @covers Imbo\Model\ListModel::getData
  */
 public function testGetData()
 {
     $list = [1, 2, 3];
     $container = 'container';
     $entry = 'entry';
     $this->model->setList($list)->setContainer($container)->setEntry($entry);
     $this->assertSame(['list' => $list, 'container' => $container, 'entry' => $entry], $this->model->getData());
 }
Example #3
0
 public function get(EventInterface $event)
 {
     $model = new ListModel();
     $model->setContainer('foo');
     $model->setEntry('bar');
     $model->setList([1, 2, 3]);
     $event->getResponse()->setModel($model);
 }