From 5572b79831f2ac786255af59977aef33476897c6 Mon Sep 17 00:00:00 2001 From: Okhin Date: Sat, 13 Oct 2018 13:07:06 +0200 Subject: [PATCH] Test for the CommandHandler --- .../functional/Handler/AddressHandlerTest.php | 4 ++-- .../functional/Handler/CommandHandlerTest.php | 23 +++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 tests/functional/Handler/CommandHandlerTest.php diff --git a/tests/functional/Handler/AddressHandlerTest.php b/tests/functional/Handler/AddressHandlerTest.php index ab58f48..65a5714 100644 --- a/tests/functional/Handler/AddressHandlerTest.php +++ b/tests/functional/Handler/AddressHandlerTest.php @@ -10,7 +10,7 @@ use LQDN\Tests\Functional\FunctionalTest; class AddressHandlerTest extends FunctionalTest { - public function notestAddressUsedDelete() + public function testAddressUsedDelete() { $this->assertTrue($this->addressExists(1)); @@ -27,7 +27,7 @@ class AddressHandlerTest extends FunctionalTest $this->assertFalse($this->addressExists(2)); } - public function notestAddressUpdate() + public function testAddressUpdate() { $this->assertTrue($this->addressExists(1)); $this->assertTrue($this->isDefaultAddress(1)); diff --git a/tests/functional/Handler/CommandHandlerTest.php b/tests/functional/Handler/CommandHandlerTest.php new file mode 100644 index 0000000..7787060 --- /dev/null +++ b/tests/functional/Handler/CommandHandlerTest.php @@ -0,0 +1,23 @@ +setExpectedException('LQDN\Exception\CommandNotAnObjectException'); + $this->container['command_handler']->handle("Not a command object"); + } + + public function testCommandNotHandledException() + { + $this->setExpectedException('LQDN\Exception\CommandNotHandledException'); + $this->container['command_handler']->handle(new Object()); + } +} + +?> -- GitLab