/**
  * Test JComponentRouterViewconfiguration::removeLayout
  *
  * @return  void
  *
  * @since   3.4
  * @covers  JComponentRouterViewconfiguration::removeLayout
  */
 public function testRemoveLayout()
 {
     $this->assertEquals(array('default'), $this->object->layouts);
     $this->object->addLayout('form');
     $this->assertEquals($this->object, $this->object->removeLayout('default'));
     $this->assertEquals(array(1 => 'form'), $this->object->layouts);
     $this->assertEquals($this->object, $this->object->removeLayout('fake'));
     $this->assertEquals(array(1 => 'form'), $this->object->layouts);
     $this->object->removeLayout('form');
     $this->assertEquals(array(), $this->object->layouts);
 }
Пример #2
0
 /**
  * Users Component router constructor
  *
  * @param   JApplicationCms  $app   The application object
  * @param   JMenu            $menu  The menu object to work with
  */
 public function __construct($app = null, $menu = null)
 {
     $this->registerView(new JComponentRouterViewconfiguration('login'));
     $profile = new JComponentRouterViewconfiguration('profile');
     $profile->addLayout('edit');
     $this->registerView($profile);
     $this->registerView(new JComponentRouterViewconfiguration('registration'));
     $this->registerView(new JComponentRouterViewconfiguration('remind'));
     $this->registerView(new JComponentRouterViewconfiguration('reset'));
     parent::__construct($app, $menu);
     $this->attachRule(new JComponentRouterRulesMenu($this));
     $params = JComponentHelper::getParams('com_content');
     if ($params->get('sef_advanced', 0)) {
         $this->attachRule(new JComponentRouterRulesStandard($this));
         $this->attachRule(new JComponentRouterRulesNomenu($this));
     } else {
         JLoader::register('UsersRouterRulesLegacy', __DIR__ . '/helpers/legacyrouter.php');
         $this->attachRule(new UsersRouterRulesLegacy($this));
     }
 }