|
@@ -110,14 +110,20 @@ class ListMapperTest extends PHPUnit_Framework_TestCase
|
|
|
public function testAdd()
|
|
|
{
|
|
|
$this->listMapper->add('fooName');
|
|
|
+ $this->listMapper->add('fooNameLabelBar', null, array('label' => 'fooBar'));
|
|
|
+ $this->listMapper->add('fooNameLabelFalse', null, array('label' => false));
|
|
|
|
|
|
$this->assertTrue($this->listMapper->has('fooName'));
|
|
|
|
|
|
$fieldDescription = $this->listMapper->get('fooName');
|
|
|
+ $fieldLabelBar = $this->listMapper->get('fooNameLabelBar');
|
|
|
+ $fieldLabelFalse = $this->listMapper->get('fooNameLabelFalse');
|
|
|
|
|
|
$this->assertInstanceOf('Sonata\AdminBundle\Admin\FieldDescriptionInterface', $fieldDescription);
|
|
|
$this->assertSame('fooName', $fieldDescription->getName());
|
|
|
$this->assertSame('fooName', $fieldDescription->getOption('label'));
|
|
|
+ $this->assertSame('fooBar', $fieldLabelBar->getOption('label'));
|
|
|
+ $this->assertFalse($fieldLabelFalse->getOption('label'));
|
|
|
}
|
|
|
|
|
|
/**
|