From c98be3ef7387ed6b7e5acb2006c93d5c72d5b1a4 Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Mon, 10 Jun 2013 12:58:12 +0200 Subject: [PATCH] Evaluate, Test and Move the items und library/Icinga/Web to the source tree Add test for Widget. refs #4256 --- library/Icinga/Web/Widget.php | 9 +++---- test/php/library/Icinga/Web/WidgetTest.php | 31 ++++++++++++++++++++++ 2 files changed, 35 insertions(+), 5 deletions(-) create mode 100644 test/php/library/Icinga/Web/WidgetTest.php diff --git a/library/Icinga/Web/Widget.php b/library/Icinga/Web/Widget.php index bc160dcdb..8d8f3d5a2 100644 --- a/library/Icinga/Web/Widget.php +++ b/library/Icinga/Web/Widget.php @@ -1,8 +1,7 @@ create('tab', array('name' => 'TEST')); + + $this->assertInstanceOf('Icinga\Web\Widget\Tab', $widget); + } + + /** + * @expectedException Icinga\Exception\ProgrammingError + * @expectedExceptionMessage There is no such widget: DOES_NOT_EXIST + */ + public function testFail1() + { + $widgetCreator = new Widget(); + $widget = $widgetCreator->create('DOES_NOT_EXIST'); + } +} \ No newline at end of file