From 11c769ebc511358ebcfd1120960766852874778a Mon Sep 17 00:00:00 2001 From: Gabriel Birke Date: Mon, 14 May 2018 10:44:17 +0200 Subject: [PATCH] Rename factory methods in DisplayPageRouteTest Factory methods that create a new instance should start with "new" instead of get. --- tests/EdgeToEdge/Routes/DisplayPageRouteTest.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/EdgeToEdge/Routes/DisplayPageRouteTest.php b/tests/EdgeToEdge/Routes/DisplayPageRouteTest.php index d1e18a5bc..05aaf689b 100644 --- a/tests/EdgeToEdge/Routes/DisplayPageRouteTest.php +++ b/tests/EdgeToEdge/Routes/DisplayPageRouteTest.php @@ -22,8 +22,8 @@ public function testWhenPageHasCustomTemplate_customTemplateIsRendered(): void { $this->createEnvironment( [], function ( Client $client, FunFunFactory $factory ): void { - $factory->setContentPagePageSelector( $this->getMockPageSelector( 'test' ) ); - $factory->setContentProvider( $this->getVfsContentProvider( [ 'test.twig' => '' ] ) ); + $factory->setContentPagePageSelector( $this->newMockPageSelector( 'test' ) ); + $factory->setContentProvider( $this->newVfsContentProvider( [ 'test.twig' => '' ] ) ); $crawler = $client->request( 'GET', '/page/test' ); @@ -35,7 +35,7 @@ function ( Client $client, FunFunFactory $factory ): void { public function testWhenPageDoesNotExist_missingResponseIsReturnedAndHasHeaderAndFooter(): void { $client = $this->createClient( [], function ( FunFunFactory $factory ): void { - $factory->setContentPagePageSelector( $this->getNotFoundPageSelector( 'kittens' ) ); + $factory->setContentPagePageSelector( $this->newNotFoundPageSelector( 'kittens' ) ); } ); $client->request( 'GET', '/page/kittens' ); @@ -70,9 +70,9 @@ public function testWhenRequestedContentPageExists_itGetsEmbeddedAndHasHeaderAnd $this->createEnvironment( [], function ( Client $client, FunFunFactory $factory ): void { - $factory->setContentPagePageSelector( $this->getMockPageSelector( 'unicorns' ) ); + $factory->setContentPagePageSelector( $this->newMockPageSelector( 'unicorns' ) ); $factory->setContentProvider( - $this->getVfsContentProvider( + $this->newVfsContentProvider( [ 'unicorns.twig' => '

Rosa plüsch einhorns tanzen auf Regenbogen

' ] ) ); @@ -96,7 +96,7 @@ public function testWhenPageNameContainsSlash_404isReturned(): void { $this->assert404( $client->getResponse() ); } - private function getMockPageSelector( string $pageId ): PageSelector { + private function newMockPageSelector( string $pageId ): PageSelector { $pageSelector = $this->createMock( PageSelector::class ); $pageSelector ->method( 'getPageId' ) @@ -106,7 +106,7 @@ private function getMockPageSelector( string $pageId ): PageSelector { return $pageSelector; } - private function getNotFoundPageSelector( string $pageId ): PageSelector { + private function newNotFoundPageSelector( string $pageId ): PageSelector { $pageSelector = $this->createMock( PageSelector::class ); $pageSelector ->method( 'getPageId' ) @@ -115,7 +115,7 @@ private function getNotFoundPageSelector( string $pageId ): PageSelector { return $pageSelector; } - private function getVfsContentProvider( array $pages ): ContentProvider { + private function newVfsContentProvider( array $pages ): ContentProvider { $content = vfsStream::setup( 'content', null, [ 'web' => [ 'pages' => $pages ],