From b6bced732e1d3a2b88cd37b0acbd6c02b91fd6c2 Mon Sep 17 00:00:00 2001 From: Hilari Moragrega Date: Fri, 9 Mar 2018 15:26:56 +0100 Subject: [PATCH] Added test for merging configs --- spec/MonitorFactorySpec.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/spec/MonitorFactorySpec.php b/spec/MonitorFactorySpec.php index 3ed71a4..e269b19 100644 --- a/spec/MonitorFactorySpec.php +++ b/spec/MonitorFactorySpec.php @@ -43,4 +43,25 @@ function it_can_built_an_working_monitor(LoggerInterface $logger) $monitor->shouldBeAnInstanceOf(Monitor::class); } + + function it_can_built_an_working_monitor_from_half_config(LoggerInterface $logger) + { + $monitor = $this->create([ + 'hostname' => 'fooserver', + 'default_tags' => ['foo' => 'bar'], + 'logger' => [ + 'instance' => $logger, + 'debug' => true, + 'metrics' => true, + 'events' => true, + ], + 'datadog' => [ + 'metrics' => true, + 'events' => true, + 'host' => '10.0.0.1' + ], + ]); + + $monitor->shouldBeAnInstanceOf(Monitor::class); + } }