From b9d335bb43e64bae5e05155ebcbffee8a2d40038 Mon Sep 17 00:00:00 2001 From: Trismegiste Date: Mon, 13 May 2013 21:49:51 +0200 Subject: [PATCH] add test for null object --- Tests/NullObject/LoggerTest.php | 35 +++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Tests/NullObject/LoggerTest.php diff --git a/Tests/NullObject/LoggerTest.php b/Tests/NullObject/LoggerTest.php new file mode 100644 index 0000000..36edb6b --- /dev/null +++ b/Tests/NullObject/LoggerTest.php @@ -0,0 +1,35 @@ +expectOutputString(null); // no output + $service->doSomething(); + } + + public function testStandardLogger() + { + $service = new Service(new PrintLogger()); + $this->expectOutputString('We are in DesignPatterns\NullObject\Service::doSomething'); + $service->doSomething(); + } + +} \ No newline at end of file