/** * {@inheritdoc} */ public function createCollection(array $data = []) { $collection = new Keywords(); if (array_key_exists('keywords', $data)) { $data = $data['keywords']; } foreach ($data as $item) { $collection->addKeyword($this->create($item)); } return $collection; }
/** * @test */ public function shouldGetAndSet() { $this->assertEquals(count($this->keywords), count($this->collection->getKeywords())); $this->assertEquals('dark', $this->collection->getKeyword(1)->getName()); $this->assertEquals(null, $this->collection->getKeyword(3)); }