/**
  * Test JComponentRouterBase::preprocess
  *
  * @return  void
  *
  * @since   3.4
  * @covers  JComponentRouterBase::preprocess
  */
 public function testPreprocess()
 {
     $app = TestMockApplication::create($this);
     $menu = TestMockMenu::create($this);
     $object = new JComponentRouterBaseInspector($app, $menu);
     $array = array('option' => 'com_test', 'view' => 'test');
     $this->assertEquals($array, $object->preprocess($array));
 }
Esempio n. 2
0
 /**
  * Gets a mock application object.
  *
  * @return  JApplication
  *
  * @since   12.1
  */
 public function getMockApplication()
 {
     // Attempt to load the real class first.
     class_exists('JApplication');
     return TestMockApplication::create($this);
 }
Esempio n. 3
0
 /**
  * Sets up the fixture.
  *
  * This method is called before a test is executed.
  *
  * @since   12.1
  *
  * @return  void
  */
 protected function setUp()
 {
     parent::setUp();
     $this->saveFactoryState();
     $this->server = $_SERVER;
     JFactory::$application = TestMockApplication::create($this);
     JFactory::$application->input = new JInput(array());
     defined('JPATH_COMPONENT') or define('JPATH_COMPONENT', JPATH_BASE . '/components/com_foobar');
     $_SERVER['REQUEST_METHOD'] = 'get';
     $_SERVER['HTTP_HOST'] = 'mydomain.com';
     $this->class = new JViewLegacy();
 }
 /**
  * Tests the JFactory::getDocument method.
  *
  * @return  void
  *
  * @since   12.1
  * @covers  JFactory::getDocument
  * @covers  JFactory::createDocument
  * @todo    Implement testGetDocument().
  */
 function testGetDocument()
 {
     JFactory::$application = TestMockApplication::create($this);
     $this->assertInstanceOf('JDocument', JFactory::getDocument(), 'Line: ' . __LINE__);
     JFactory::$application = null;
     $this->markTestIncomplete('This test has not been implemented completely yet.');
 }
Esempio n. 5
0
 /**
  * Tests the JFactory::getDocument method.
  *
  * @return  void
  *
  * @since   12.1
  */
 public function testGetDocument()
 {
     JFactory::$application = TestMockApplication::create($this);
     $this->assertInstanceOf('JDocument', JFactory::getDocument(), 'Line: ' . __LINE__);
     JFactory::$application = null;
 }