コード例 #1
0
 /**
  * @covers ::getOptions
  */
 public function testGetOptions()
 {
     $this->pluginDefinition['options'] = array('attributes' => array('class' => array('example')));
     $this->setupLocalTaskDefault();
     $route_match = new RouteMatch('', new Route('/'));
     $this->assertEquals($this->pluginDefinition['options'], $this->localTaskBase->getOptions($route_match));
     $this->localTaskBase->setActive(TRUE);
     $this->assertEquals(array('attributes' => array('class' => array('example', 'active'))), $this->localTaskBase->getOptions($route_match));
 }
コード例 #2
0
 /**
  * Tests the getOption method.
  *
  * @see \Drupal\Core\Menu\LocalTaskDefault::getOption()
  */
 public function testGetOptions()
 {
     $this->pluginDefinition['options'] = array('attributes' => array('class' => array('example')));
     $this->setupLocalTaskDefault();
     $request = Request::create('/');
     $this->assertEquals($this->pluginDefinition['options'], $this->localTaskBase->getOptions($request));
     $this->localTaskBase->setActive(TRUE);
     $this->assertEquals(array('attributes' => array('class' => array('example', 'active'))), $this->localTaskBase->getOptions($request));
 }