/** * Tests the JApplicationCms::__construct method with dependancy injection. * * @return void * * @since 3.2 */ public function test__constructDependancyInjection() { $mockInput = $this->getMock('JInput', array('test'), array(), '', false); $mockInput->expects($this->any())->method('test')->will($this->returnValue('ok')); $config = new JRegistry(); $config->set('session', false); $mockClient = $this->getMock('JApplicationWebClient', array('test'), array(), '', false); $mockClient->expects($this->any())->method('test')->will($this->returnValue('ok')); $inspector = new JApplicationCmsInspector($mockInput, $config, $mockClient); $this->assertThat($inspector->input->test(), $this->equalTo('ok'), 'Tests input injection.'); $this->assertThat($inspector->get('session'), $this->isFalse(), 'Tests config injection.'); $this->assertThat($inspector->client->test(), $this->equalTo('ok'), 'Tests client injection.'); }
/** * Tests the JApplicationCms::__construct method with dependancy injection. * * @return void * * @since 3.2 */ public function test__constructDependancyInjection() { if (PHP_VERSION == '5.4.29' || PHP_VERSION == '5.5.13' || PHP_MINOR_VERSION == '6') { $this->markTestSkipped('Test is skipped due to a PHP bug in versions 5.4.29 and 5.5.13 and a change in behavior in the 5.6 branch'); } $mockInput = $this->getMock('JInput', array('test'), array(), '', false); $mockInput->expects($this->any())->method('test')->will($this->returnValue('ok')); $config = new JRegistry(); $config->set('session', false); $mockClient = $this->getMock('JApplicationWebClient', array('test'), array(), '', false); $mockClient->expects($this->any())->method('test')->will($this->returnValue('ok')); $inspector = new JApplicationCmsInspector($mockInput, $config, $mockClient); $this->assertThat($inspector->input->test(), $this->equalTo('ok'), 'Tests input injection.'); $this->assertFalse($inspector->get('session'), 'Tests config injection.'); $this->assertThat($inspector->client->test(), $this->equalTo('ok'), 'Tests client injection.'); }