Skip to content

Commit

Permalink
Updated unit testing method - thanks @mbabker
Browse files Browse the repository at this point in the history
  • Loading branch information
Kubik-Rubik committed Jul 7, 2015
1 parent 711e64c commit 0cf5193
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions tests/unit/suites/libraries/cms/html/JHtmlBehaviorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -630,17 +630,10 @@ public function testKeepalive()
// 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'));
$mock->expects($this->any())
// We create a stub (not a mock because we don't enforce whether it is called or not) to return a value from getTemplate
JFactory::$application->expects($this->any())
->method('getTemplate')
->will($this->returnValue($template));

// @todo We need to mock this.
$mock->input = new JInput;

JFactory::$application = $mock;
->willReturn($template);

JHtmlBehaviorInspector::keepalive();
$this->assertEquals(
Expand Down

0 comments on commit 0cf5193

Please sign in to comment.