From 89a2f40c816904651b1e700d991918112e45308d Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Mon, 21 Mar 2016 10:09:57 +0100 Subject: [PATCH] IcingaCommandTest: add new test --- .../Director/Objects/IcingaCommandTest.php | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 test/php/library/Director/Objects/IcingaCommandTest.php diff --git a/test/php/library/Director/Objects/IcingaCommandTest.php b/test/php/library/Director/Objects/IcingaCommandTest.php new file mode 100644 index 00000000..26076748 --- /dev/null +++ b/test/php/library/Director/Objects/IcingaCommandTest.php @@ -0,0 +1,49 @@ +command(); + $command->arguments = array( + '-H' => '$host$' + ); + + $this->assertEquals( + '-H', + $command->arguments()->get('-H')->argument_name + ); + + $this->assertEquals( + '$host$', + $command->toPlainObject()->arguments['-H'] + ); + + $command->arguments()->get('-H')->required = true; + } + + protected function command() + { + return IcingaCommand::create( + array( + 'object_name' => $this->testCommandName, + 'object_type' => 'object' + ) + ); + } + + public function XXtearDown() + { + $db = $this->getDb(); + if (IcingaTimePeriod::exists($this->testPeriodName, $db)) { + IcingaTimePeriod::load($this->testPeriodName, $db)->delete(); + } + } +}