/** * @test */ public function buildPrependsIndexFileIfRewriteUrlsIsOff() { $this->mockRouter->expects($this->once())->method('resolve')->will($this->returnValue('resolvedUri')); $mockEnvironment = $this->getMock('TYPO3\\Flow\\Utility\\Environment', array('isRewriteEnabled'), array(), '', FALSE); $this->inject($this->uriBuilder, 'environment', $mockEnvironment); $expectedResult = 'index.php/resolvedUri'; $actualResult = $this->uriBuilder->build(); $this->assertEquals($expectedResult, $actualResult); }
/** * @test */ public function buildPrependsIndexFileIfRewriteUrlsIsOff() { $this->mockRouter->expects($this->once())->method('resolve')->will($this->returnValue('resolvedUri')); $mockEnvironment = $this->getMockBuilder(\TYPO3\Flow\Utility\Environment::class)->disableOriginalConstructor()->setMethods(array('isRewriteEnabled'))->getMock(); $this->inject($this->uriBuilder, 'environment', $mockEnvironment); $expectedResult = 'index.php/resolvedUri'; $actualResult = $this->uriBuilder->build(); $this->assertEquals($expectedResult, $actualResult); }