Skip to content

Commit

Permalink
CS
Browse files Browse the repository at this point in the history
  • Loading branch information
bytehead committed Jan 2, 2022
1 parent d1e7104 commit 3fcbcc2
Showing 1 changed file with 7 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,15 @@ public function testOnlyModifyFieldsWithProperInputType(): void
'eval' => [
'rootPages' => [],
'blankOptionLabel' => null,
]
],
],
'field2' => [
'eval' => [],
],
'field3' => [
'inputType' => 'text',
],
], $GLOBALS['TL_DCA']['tl_module']['fields']);
], $this->getGlobalsArray());

$this->unsetGlobalsArray();
}
Expand Down Expand Up @@ -180,7 +180,7 @@ public function testAddRootPagesToFieldConfig(): void
'blankOptionLabel' => null,
],
],
], $GLOBALS['TL_DCA']['tl_module']['fields']);
], $this->getGlobalsArray());

$this->unsetGlobalsArray();
}
Expand All @@ -190,25 +190,14 @@ private function populateGlobalsArray(array $data): void
$GLOBALS['TL_DCA']['tl_module']['fields'] = $data;
}

private function unsetGlobalsArray(): void
private function getGlobalsArray(): array
{
unset($GLOBALS['TL_DCA']['tl_module']['fields']);
return $GLOBALS['TL_DCA']['tl_module']['fields'];
}

private function getRequest(bool $withPageModel = false, PageModel $pageModel = null): Request
private function unsetGlobalsArray(): void
{
$request = new Request();
$request->attributes->set('pageModel', null);

$pageModel ??= $this->createMock(PageModel::class);

if ($withPageModel) {
$request->attributes->set('pageModel', $pageModel);
}

$request->setSession($this->createMock(SessionInterface::class));

return $request;
unset($GLOBALS['TL_DCA']['tl_module']['fields']);
}

/**
Expand Down

0 comments on commit 3fcbcc2

Please sign in to comment.