Skip to content
This repository has been archived by the owner on Jul 16, 2021. It is now read-only.

Commit

Permalink
Use getMockBuilder() to prevent warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
aimeos committed Aug 14, 2016
1 parent ca0fbe6 commit 117540b
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions lib/custom/tests/MW/View/Helper/Url/FlowTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,26 @@ protected function setUp()
$view = new \Aimeos\MW\View\Standard();

$mockHttpRequest = $this->getMockBuilder( 'TYPO3\Flow\Http\Request' )
->disableOriginalConstructor()
->setMethods( array( 'getBaseUri' ) )
->disableOriginalConstructor()
->getMock();
$mockHttpRequest->expects( $this->any() )
->method( 'getBaseUri' )
->will( $this->returnValue( 'http://localhost/' ) );

$mockMainRequest = $this->getMock( 'TYPO3\Flow\Mvc\ActionRequest',
array( 'getControllerObjectName', 'getArgumentNamespace' ), array( $mockHttpRequest ) );
$mockMainRequest = $this->getMockBuilder( 'TYPO3\Flow\Mvc\ActionRequest' )
->setMethods( array( 'getControllerObjectName', 'getArgumentNamespace' ) )
->setConstructorArgs( array( $mockHttpRequest ) )
->getMock();
$mockMainRequest->expects( $this->any() )
->method( 'getArgumentNamespace' )
->will( $this->returnValue( 'ai' ) );

$this->mockRouter = $this->getMockBuilder( 'TYPO3\Flow\Mvc\Routing\Router' )->getMock();
$mockEnv = $this->getMock( 'TYPO3\Flow\Utility\Environment', array( 'isRewriteEnabled' ), array(), '', false );
$mockEnv = $this->getMockBuilder( 'TYPO3\Flow\Utility\Environment' )
->setMethods( array( 'isRewriteEnabled' ) )
->disableOriginalConstructor()
->getMock();

$builder = new \TYPO3\Flow\Mvc\Routing\UriBuilder();
$builder->setRequest( $mockMainRequest );
Expand Down

0 comments on commit 117540b

Please sign in to comment.