/**
  * @test
  */
 public function buildPrependsIndexFileIfRewriteUrlsIsOff()
 {
     $this->mockRouter->expects($this->once())->method('resolve')->will($this->returnValue('resolvedUri'));
     $mockEnvironment = $this->getMockBuilder(Utility\Environment::class)->disableOriginalConstructor()->setMethods(['isRewriteEnabled'])->getMock();
     $this->inject($this->uriBuilder, 'environment', $mockEnvironment);
     $expectedResult = 'index.php/resolvedUri';
     $actualResult = $this->uriBuilder->build();
     $this->assertEquals($expectedResult, $actualResult);
 }
 /**
  * Builds the URI
  *
  * @param array $arguments optional URI arguments. Will be merged with $this->arguments with precedence to $arguments
  * @return string The URI
  * @api
  */
 public function build(array $arguments = [])
 {
     $arguments = Arrays::arrayMergeRecursiveOverrule($this->arguments, $arguments);
     $arguments = $this->mergeArgumentsWithRequestArguments($arguments);
     $uri = $this->router->resolve($arguments);
     $this->lastArguments = $arguments;
     if (!$this->environment->isRewriteEnabled()) {
         $uri = 'index.php/' . $uri;
     }
     $httpRequest = $this->request->getHttpRequest();
     if ($this->createAbsoluteUri === true) {
         $uri = $httpRequest->getBaseUri() . $uri;
     } elseif (!$this->createRelativePaths) {
         $uri = $httpRequest->getScriptRequestPath() . $uri;
     }
     if ($this->section !== '') {
         $uri .= '#' . $this->section;
     }
     return $uri;
 }