コード例 #1
0
 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'));
 }
コード例 #2
0
 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();
 }
コード例 #3
0
 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);
 }