Skip to content

Commit

Permalink
Rename factory methods in DisplayPageRouteTest
Browse files Browse the repository at this point in the history
Factory methods that create a new instance should start with "new"
instead of get.
  • Loading branch information
gbirke committed May 14, 2018
1 parent 2a7c93c commit 11c769e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/EdgeToEdge/Routes/DisplayPageRouteTest.php
Expand Up @@ -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' );

Expand All @@ -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' );
Expand Down Expand Up @@ -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' => '<p>Rosa pl眉sch einhorns tanzen auf Regenbogen</p>' ]
)
);
Expand All @@ -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' )
Expand All @@ -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' )
Expand All @@ -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 ],
Expand Down

0 comments on commit 11c769e

Please sign in to comment.