Ejemplo n.º 1
0
 /**
  * {@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;
 }
Ejemplo n.º 2
0
 /**
  * @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));
 }