/** * Tests the noframes method. * * @return void * * @since 3.1 */ public function testNoFrames() { // We generate a random template name so that we don't collide or hit anything// $template = 'mytemplate' . rand(1, 10000); // We create a stub (not a mock because we don't enforce whether it is called or not) // to return a value from getTemplate $mock = $this->getMock('myMockObject', array('getTemplate', 'setHeader')); $mock->expects($this->any())->method('getTemplate')->will($this->returnValue($template)); // @todo We need to mock this. $mock->input = new JInput(); JFactory::$application = $mock; JHtmlBehaviorInspector::noframes(); $this->assertEquals(array('JHtmlBehavior::core' => true, 'JHtmlBehavior::noframes' => true), JHtmlBehaviorInspector::getLoaded()); }
/** * Tests the noframes method. * * @return void * * @since 3.1 */ public function testNoFrames() { JHtmlBehavior::noframes(); $this->assertEquals(array('JHtmlBehavior::core' => true, 'JHtmlBehavior::noframes' => true), JHtmlBehaviorInspector::getLoaded(), 'The no frames behavior is not loaded with all dependencies'); }