Skip to content

Commit

Permalink
Applied fixes from FlintCI
Browse files Browse the repository at this point in the history
  • Loading branch information
soullivaneuh authored and OskarStark committed Feb 12, 2020
1 parent d3f0ee1 commit 5d026f2
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 16 deletions.
4 changes: 3 additions & 1 deletion src/Block/Service/AbstractCategoriesBlockService.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ public function buildEditForm(FormMapper $formMapper, BlockInterface $block)
],
]);

$formMapper->add(ImmutableArrayType::class, [
$formMapper->add(
ImmutableArrayType::class,
[
'keys' => [
['title', TextType::class, [
'required' => false,
Expand Down
3 changes: 2 additions & 1 deletion src/Block/Service/AbstractCollectionsBlockService.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ public function buildEditForm(FormMapper $formMapper, BlockInterface $block)

$formMapper->add(
'settings',
ImmutableArrayType::class, [
ImmutableArrayType::class,
[
'keys' => [
['title', TextType::class, [
'required' => false,
Expand Down
5 changes: 4 additions & 1 deletion src/Block/Service/AbstractTagsBlockService.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ public function buildEditForm(FormMapper $formMapper, BlockInterface $block)
],
]);

$formMapper->add('settings', ImmutableArrayType::class, [
$formMapper->add(
'settings',
ImmutableArrayType::class,
[
'keys' => [
['title', TextType::class, [
'required' => false,
Expand Down
30 changes: 17 additions & 13 deletions tests/Controller/CategoryAdminControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,16 +249,14 @@ protected function setUp(): void
$this->admin->expects($this->any())
->method('generateUrl')
->willReturnCallback(

static function ($name, array $parameters = [], $absolute = false) {
$result = $name;
if (!empty($parameters)) {
$result .= '?'.http_build_query($parameters);
}

return $result;
static function ($name, array $parameters = [], $absolute = false) {
$result = $name;
if (!empty($parameters)) {
$result .= '?'.http_build_query($parameters);
}

return $result;
}
);

$this->admin->expects($this->any())
Expand All @@ -280,7 +278,9 @@ public function testListActionWithoutFilter(): void

$result = $this->controller->listAction($this->request);
$this->assertInstanceOf(
RedirectResponse::class, $result);
RedirectResponse::class,
$result
);
$this->assertSame('tree?hide_context=0', $result->getTargetUrl());
}

Expand Down Expand Up @@ -322,8 +322,10 @@ public function testListAction($context): void
->method('getPersistentParameter')
->willReturn($context);

$this->assertInstanceOf(Response::class,
$this->controller->listAction($this->request));
$this->assertInstanceOf(
Response::class,
$this->controller->listAction($this->request)
);
}

public function listActionData()
Expand Down Expand Up @@ -387,8 +389,10 @@ public function testTreeAction($context, $categories): void
->method('getRootCategoriesSplitByContexts')
->willReturn($categoriesMock);

$this->assertInstanceOf(Response::class,
$this->controller->treeAction($this->request));
$this->assertInstanceOf(
Response::class,
$this->controller->treeAction($this->request)
);
}

public function treeActionData()
Expand Down

0 comments on commit 5d026f2

Please sign in to comment.