public function testMethods()
 {
     $collection = new FieldDescriptionCollection();
     $fieldDescription = $this->getMock('Sonata\\AdminBundle\\Admin\\FieldDescriptionInterface');
     $fieldDescription->expects($this->once())->method('getName')->will($this->returnValue('title'));
     $collection->add($fieldDescription);
     $fieldDescription = $this->getMock('Sonata\\AdminBundle\\Admin\\FieldDescriptionInterface');
     $fieldDescription->expects($this->once())->method('getName')->will($this->returnValue('position'));
     $collection->add($fieldDescription);
     $this->assertFalse($collection->has('foo'));
     $this->assertFalse(isset($collection['foo']));
     $this->assertTrue($collection->has('title'));
     $this->assertTrue(isset($collection['title']));
     $this->assertCount(2, $collection->getElements());
     $this->assertCount(2, $collection);
     $this->isInstanceOf('Sonata\\AdminBundle\\Admin\\FieldDescriptionInterface', $collection['title']);
     $this->isInstanceOf('Sonata\\AdminBundle\\Admin\\FieldDescriptionInterface', $collection->get('title'));
     $collection->remove('title');
     $this->assertFalse($collection->has('title'));
     unset($collection['position']);
     $this->assertCount(0, $collection->getElements());
     $this->assertCount(0, $collection);
 }
 /**
  * {@inheritdoc}
  */
 public function has($key)
 {
     return $this->list->has($key);
 }