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 testAddViewInlineAction() { $terminateErrorIgnore = \PHPUnit_Util_ErrorHandler::handleErrorOnce(E_USER_DEPRECATED); $this->assertFalse($this->listMapper->has('_action')); $this->listMapper->add('_action', 'actions', array('actions' => array('view' => array()))); $this->assertTrue($this->listMapper->has('_action')); $fieldDescription = $this->listMapper->get('_action'); $this->assertInstanceOf('Sonata\\AdminBundle\\Admin\\FieldDescriptionInterface', $fieldDescription); $this->assertEquals('_action', $fieldDescription->getName()); $this->assertCount(1, $fieldDescription->getOption('actions')); $this->assertEquals(array('show' => array()), $fieldDescription->getOption('actions')); $terminateErrorIgnore(); }
public function testAddViewInlineAction() { // ignore E_USER_DEPRECATED error $previousErrorHandler = set_error_handler(function () { }, E_USER_DEPRECATED); $this->assertFalse($this->listMapper->has('_action')); $this->listMapper->add('_action', 'actions', array('actions' => array('view' => array()))); $this->assertTrue($this->listMapper->has('_action')); $fieldDescription = $this->listMapper->get('_action'); $this->assertInstanceOf('Sonata\\AdminBundle\\Admin\\FieldDescriptionInterface', $fieldDescription); $this->assertEquals('_action', $fieldDescription->getName()); $this->assertCount(1, $fieldDescription->getOption('actions')); $this->assertEquals(array('show' => array()), $fieldDescription->getOption('actions')); set_error_handler($previousErrorHandler); }