|
@@ -119,7 +119,10 @@ class ListMapperTest extends \PHPUnit_Framework_TestCase
|
|
|
$this->assertSame('fooName', $fieldDescription->getOption('label'));
|
|
|
}
|
|
|
|
|
|
- public function testAddViewInlineAction()
|
|
|
+ /**
|
|
|
+ * @group legacy
|
|
|
+ */
|
|
|
+ public function testLegacyAddViewInlineAction()
|
|
|
{
|
|
|
$this->assertFalse($this->listMapper->has('_action'));
|
|
|
$this->listMapper->add('_action', 'actions', array('actions' => array('view' => array())));
|
|
@@ -134,6 +137,21 @@ class ListMapperTest extends \PHPUnit_Framework_TestCase
|
|
|
$this->assertSame(array('show' => array()), $fieldDescription->getOption('actions'));
|
|
|
}
|
|
|
|
|
|
+ public function testAddViewInlineAction()
|
|
|
+ {
|
|
|
+ $this->assertFalse($this->listMapper->has('_action'));
|
|
|
+ $this->listMapper->add('_action', 'actions', array('actions' => array('show' => array())));
|
|
|
+
|
|
|
+ $this->assertTrue($this->listMapper->has('_action'));
|
|
|
+
|
|
|
+ $fieldDescription = $this->listMapper->get('_action');
|
|
|
+
|
|
|
+ $this->assertInstanceOf('Sonata\AdminBundle\Admin\FieldDescriptionInterface', $fieldDescription);
|
|
|
+ $this->assertSame('_action', $fieldDescription->getName());
|
|
|
+ $this->assertCount(1, $fieldDescription->getOption('actions'));
|
|
|
+ $this->assertSame(array('show' => array()), $fieldDescription->getOption('actions'));
|
|
|
+ }
|
|
|
+
|
|
|
public function testAddRemove()
|
|
|
{
|
|
|
$this->assertFalse($this->listMapper->has('fooName'));
|