From 07996deafd162f39f51db239261d9c7641ee146b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Attali?= Date: Sat, 4 May 2019 14:22:06 +0200 Subject: [PATCH] Test load events --- src/DependencyInjection/Configuration.php | 1 + src/Entity/Event.php | 2 +- tests/Controller/CalendarControllerTest.php | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index 316d743..6a19989 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -21,6 +21,7 @@ public function getConfigTreeBuilder(): TreeBuilder { $treeBuilder = new TreeBuilder(); $treeBuilder->root('calendar'); + return $treeBuilder; } } diff --git a/src/Entity/Event.php b/src/Entity/Event.php index 4e4bd68..6d8b6af 100755 --- a/src/Entity/Event.php +++ b/src/Entity/Event.php @@ -122,7 +122,7 @@ public function addOption(string $name, $value): void public function removeOption(string $name) { - if (!isset($this->options[$name]) && !array_key_exists($name, $this->options)) { + if (!isset($this->options[$name]) && !\array_key_exists($name, $this->options)) { return null; } diff --git a/tests/Controller/CalendarControllerTest.php b/tests/Controller/CalendarControllerTest.php index 29ea961..302d2e5 100755 --- a/tests/Controller/CalendarControllerTest.php +++ b/tests/Controller/CalendarControllerTest.php @@ -42,7 +42,7 @@ public function testItProvidesAnEventsFeedForACalendar() { $this->request->get('start')->willReturn('2016-03-01'); $this->request->get('end')->willReturn('2016-03-19 15:11:00'); - $this->request->get('filters', [])->willReturn([]); + $this->request->get('filters', '{}')->willReturn('{}'); $this->calendarEvent->getEvents()->willReturn([$this->event]); @@ -82,7 +82,7 @@ public function testItNotFindAnyEvents() { $this->request->get('start')->willReturn('2016-03-01'); $this->request->get('end')->willReturn('2016-03-19 15:11:00'); - $this->request->get('filters', [])->willReturn([]); + $this->request->get('filters', '{}')->willReturn('{}'); $this->calendarEvent->getEvents()->willReturn([$this->event]);