From 98ca15d1fb52f2e0d4f5d4e8d6437aa7d986f721 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 28 Apr 2014 14:03:52 +0200 Subject: [PATCH] Mark less important or non-testable code as skipped for code coverage refs #6011 --- .../clicommands/AutocompleteCommand.php | 2 ++ application/clicommands/HelpCommand.php | 2 ++ application/clicommands/ModuleCommand.php | 2 ++ application/clicommands/WebCommand.php | 2 ++ .../controllers/AuthenticationController.php | 2 ++ application/controllers/ConfigController.php | 2 ++ .../controllers/DashboardController.php | 4 +-- application/controllers/ErrorController.php | 4 +-- application/controllers/FilterController.php | 4 +-- application/controllers/IndexController.php | 4 +-- application/controllers/LayoutController.php | 4 +-- application/controllers/ListController.php | 4 +-- .../controllers/PreferenceController.php | 4 +-- application/controllers/SearchController.php | 8 ++--- application/controllers/StaticController.php | 4 +-- .../forms/Authentication/LoginForm.php | 2 ++ .../forms/Config/ConfirmRemovalForm.php | 2 ++ application/forms/Config/GeneralForm.php | 2 ++ application/forms/Config/LoggingForm.php | 2 ++ application/forms/Dashboard/AddUrlForm.php | 9 ++---- application/forms/Preference/GeneralForm.php | 2 ++ application/views/helpers/FormDateTime.php | 6 ++-- application/views/helpers/FormNumber.php | 6 ++-- .../views/helpers/FormTriStateCheckbox.php | 4 +-- .../Application/ApplicationBootstrap.php | 2 ++ library/Icinga/Application/Benchmark.php | 2 ++ library/Icinga/Application/Cli.php | 2 ++ library/Icinga/Application/EmbeddedWeb.php | 2 ++ library/Icinga/Application/LegacyWeb.php | 2 ++ library/Icinga/Application/Platform.php | 2 ++ library/Icinga/Application/Web.php | 2 ++ library/Icinga/File/Pdf.php | 2 ++ library/Icinga/Logger/Writer/SyslogWriter.php | 2 ++ library/Icinga/User/Message.php | 4 ++- library/Icinga/Util/File.php | 4 ++- .../Web/Controller/ActionController.php | 2 ++ .../Web/Controller/BaseConfigController.php | 4 ++- .../Controller/BasePreferenceController.php | 2 ++ .../Web/Controller/ControllerTabCollector.php | 10 +++---- .../Web/Form/Decorator/BootstrapForm.php | 2 ++ .../Web/Form/Decorator/ConditionalHidden.php | 2 ++ .../Icinga/Web/Form/Decorator/HelpText.php | 4 ++- library/Icinga/Web/Hook/Grapher.php | 2 ++ library/Icinga/Web/Hook/Ticket.php | 2 ++ library/Icinga/Web/JavaScript.php | 2 ++ library/Icinga/Web/LessCompiler.php | 2 ++ library/Icinga/Web/Request.php | 2 ++ library/Icinga/Web/Session.php | 2 ++ library/Icinga/Web/StyleSheet.php | 2 ++ library/Icinga/Web/View.php | 2 ++ library/Icinga/Web/Widget.php | 3 +- library/Icinga/Web/Widget/AbstractWidget.php | 5 ++-- library/Icinga/Web/Widget/AlertMessageBox.php | 8 +++-- .../Web/Widget/Chart/HistoryColorGrid.php | 2 ++ library/Icinga/Web/Widget/Chart/InlinePie.php | 3 +- library/Icinga/Web/Widget/Dashboard.php | 1 - .../Icinga/Web/Widget/FilterBadgeRenderer.php | 2 ++ library/Icinga/Web/Widget/FilterBox.php | 2 ++ library/Icinga/Web/Widget/SortBox.php | 5 ++-- .../Web/Widget/Tabextension/BasketAction.php | 6 ++-- .../Widget/Tabextension/DashboardAction.php | 8 ++--- .../Web/Widget/Tabextension/OutputFormat.php | 30 ++++++++----------- .../Web/Widget/Tabextension/Tabextension.php | 2 +- test/php/phpunit.xml | 14 ++++++--- 64 files changed, 159 insertions(+), 87 deletions(-) diff --git a/application/clicommands/AutocompleteCommand.php b/application/clicommands/AutocompleteCommand.php index b41b59fd8..4171b27c1 100644 --- a/application/clicommands/AutocompleteCommand.php +++ b/application/clicommands/AutocompleteCommand.php @@ -1,4 +1,5 @@ fail("Not implemented yet"); } } +// @codeCoverageIgnoreEnd diff --git a/application/clicommands/WebCommand.php b/application/clicommands/WebCommand.php index 4ad8112cc..12d140f43 100644 --- a/application/clicommands/WebCommand.php +++ b/application/clicommands/WebCommand.php @@ -1,4 +1,5 @@ view->dashboard = $dashboard; } } -// @codingStandardsIgnoreEnd +// @codeCoverageIgnoreEnd diff --git a/application/controllers/ErrorController.php b/application/controllers/ErrorController.php index d2fc5c5ef..343a40b7f 100644 --- a/application/controllers/ErrorController.php +++ b/application/controllers/ErrorController.php @@ -1,5 +1,5 @@ view->request = $error->request; } } -// @codingStandardsIgnoreEnd +// @codeCoverageIgnoreEnd diff --git a/application/controllers/FilterController.php b/application/controllers/FilterController.php index 72f0a2ad0..74ade2492 100644 --- a/application/controllers/FilterController.php +++ b/application/controllers/FilterController.php @@ -1,4 +1,5 @@ renderScript('parts/topbar.phtml'); } } -// @codingStandardsIgnoreEnd +// @codeCoverageIgnoreEnd diff --git a/application/controllers/ListController.php b/application/controllers/ListController.php index a2c1e5138..46a370df6 100644 --- a/application/controllers/ListController.php +++ b/application/controllers/ListController.php @@ -1,5 +1,5 @@ view->form = $form; } } -// @codingStandardsIgnoreEnd +// @codeCoverageIgnoreEnd diff --git a/application/controllers/SearchController.php b/application/controllers/SearchController.php index d0a76a737..5760803da 100644 --- a/application/controllers/SearchController.php +++ b/application/controllers/SearchController.php @@ -1,10 +1,5 @@ - * @license http://www.icinga.org/license/gpl2 GPL, version 2 - */ +// @codeCoverageIgnoreStart use Icinga\Web\Controller\ActionController; use Icinga\Application\Icinga; @@ -50,3 +45,4 @@ class SearchController extends ActionController $this->view->tabs = $dashboard->getTabs(); } } +// @codeCoverageIgnoreEnd diff --git a/application/controllers/StaticController.php b/application/controllers/StaticController.php index 1b85618f6..17089510a 100644 --- a/application/controllers/StaticController.php +++ b/application/controllers/StaticController.php @@ -1,5 +1,5 @@ printStack(); } } -// @codingStandardsIgnoreEnd +// @codeCoverageIgnoreEnd diff --git a/application/forms/Authentication/LoginForm.php b/application/forms/Authentication/LoginForm.php index b4e79cbe8..97ca3ea2c 100644 --- a/application/forms/Authentication/LoginForm.php +++ b/application/forms/Authentication/LoginForm.php @@ -1,4 +1,5 @@ setSubmitLabel("Add To Dashboard"); - } } +// @codeCoverageIgnoreEnd diff --git a/application/forms/Preference/GeneralForm.php b/application/forms/Preference/GeneralForm.php index ca2b6699f..512b54689 100644 --- a/application/forms/Preference/GeneralForm.php +++ b/application/forms/Preference/GeneralForm.php @@ -1,4 +1,5 @@ getClosingBracket(); } } - -// @codingStandardsIgnoreStop +// @codeCoverageIgnoreEnd diff --git a/application/views/helpers/FormTriStateCheckbox.php b/application/views/helpers/FormTriStateCheckbox.php index c41664437..5db0532fc 100644 --- a/application/views/helpers/FormTriStateCheckbox.php +++ b/application/views/helpers/FormTriStateCheckbox.php @@ -1,6 +1,5 @@ '; } } +// @codeCoverageIgnoreEnd diff --git a/library/Icinga/Application/ApplicationBootstrap.php b/library/Icinga/Application/ApplicationBootstrap.php index df8d6a0e1..c0cb83841 100644 --- a/library/Icinga/Application/ApplicationBootstrap.php +++ b/library/Icinga/Application/ApplicationBootstrap.php @@ -1,4 +1,5 @@ loadEnabledModules(); } } +// @codeCoverageIgnoreEnd diff --git a/library/Icinga/Application/LegacyWeb.php b/library/Icinga/Application/LegacyWeb.php index bf1ff3a45..acce4ad47 100644 --- a/library/Icinga/Application/LegacyWeb.php +++ b/library/Icinga/Application/LegacyWeb.php @@ -1,4 +1,5 @@ legacyBasedir; } } +// @codeCoverageIgnoreEnd diff --git a/library/Icinga/Application/Platform.php b/library/Icinga/Application/Platform.php index 80bb6896d..dfc98819d 100644 --- a/library/Icinga/Application/Platform.php +++ b/library/Icinga/Application/Platform.php @@ -1,4 +1,5 @@ level; } } +// @codeCoverageIgnoreEnd diff --git a/library/Icinga/Util/File.php b/library/Icinga/Util/File.php index 47b0deb6c..c46025ebc 100644 --- a/library/Icinga/Util/File.php +++ b/library/Icinga/Util/File.php @@ -1,4 +1,5 @@ view->tabs = ControllerTabCollector::collectControllerTabs('ConfigController'); } } +// @codeCoverageIgnoreEnd diff --git a/library/Icinga/Web/Controller/BasePreferenceController.php b/library/Icinga/Web/Controller/BasePreferenceController.php index e1c330413..5365ff40f 100644 --- a/library/Icinga/Web/Controller/BasePreferenceController.php +++ b/library/Icinga/Web/Controller/BasePreferenceController.php @@ -1,4 +1,5 @@ save($currentPreferences); } } +// @codeCoverageIgnoreEnd diff --git a/library/Icinga/Web/Controller/ControllerTabCollector.php b/library/Icinga/Web/Controller/ControllerTabCollector.php index dded99830..a29e5d57a 100644 --- a/library/Icinga/Web/Controller/ControllerTabCollector.php +++ b/library/Icinga/Web/Controller/ControllerTabCollector.php @@ -1,4 +1,5 @@ '; } } +// @codeCoverageIgnoreEnd diff --git a/library/Icinga/Web/Form/Decorator/ConditionalHidden.php b/library/Icinga/Web/Form/Decorator/ConditionalHidden.php index 305054a88..3964dc7e6 100644 --- a/library/Icinga/Web/Form/Decorator/ConditionalHidden.php +++ b/library/Icinga/Web/Form/Decorator/ConditionalHidden.php @@ -1,4 +1,5 @@ user; } } +// @codeCoverageIgnoreEnd diff --git a/library/Icinga/Web/Session.php b/library/Icinga/Web/Session.php index ef7887d61..220c6b4f7 100644 --- a/library/Icinga/Web/Session.php +++ b/library/Icinga/Web/Session.php @@ -1,4 +1,5 @@ renderVertical($grid); } } +// @codeCoverageIgnoreEnd diff --git a/library/Icinga/Web/Widget/Chart/InlinePie.php b/library/Icinga/Web/Widget/Chart/InlinePie.php index d38163aa6..c2ff99314 100644 --- a/library/Icinga/Web/Widget/Chart/InlinePie.php +++ b/library/Icinga/Web/Widget/Chart/InlinePie.php @@ -1,4 +1,5 @@ nodeToBadge(Tree::normalizeTree($this->tree->root)); } } +// @codeCoverageIgnoreEnd diff --git a/library/Icinga/Web/Widget/FilterBox.php b/library/Icinga/Web/Widget/FilterBox.php index 4395129ff..1c986ded2 100644 --- a/library/Icinga/Web/Widget/FilterBox.php +++ b/library/Icinga/Web/Widget/FilterBox.php @@ -1,4 +1,5 @@ render($view), $html); } } +// @codeCoverageIgnoreEnd diff --git a/library/Icinga/Web/Widget/SortBox.php b/library/Icinga/Web/Widget/SortBox.php index a3ee99a8f..97e528784 100644 --- a/library/Icinga/Web/Widget/SortBox.php +++ b/library/Icinga/Web/Widget/SortBox.php @@ -1,4 +1,5 @@ not show. - * */ public function __construct(array $disabled = array()) { - foreach ($this->supportedTypes as $type => $values) { - if (in_array($type, $disabled)) { - continue; + foreach ($this->supportedTypes as $type => $tabConfig) { + if (!in_array($type, $disabled)) { + $tabConfig['url'] = Url::fromRequest(); + $tabConfig['tagParams'] = array( + 'target' => '_blank' + ); + $this->tabs[] = new Tab($tabConfig); } - if (!isset($this->supportedTypes[$type])) { - Logger::error('Tried to add an unsupported output type: %s', $type); - continue; - } - $tabConfig = $this->supportedTypes[$type]; - $tabConfig['url'] = Url::fromRequest(); - $tabConfig['tagParams'] = array( - 'target' => '_blank' - ); - $this->tabs[] = new Tab($tabConfig); } } @@ -132,3 +125,4 @@ class OutputFormat implements Tabextension } } } +// @codeCoverageIgnoreEnd diff --git a/library/Icinga/Web/Widget/Tabextension/Tabextension.php b/library/Icinga/Web/Widget/Tabextension/Tabextension.php index 2cf2c7b45..5d51379ef 100644 --- a/library/Icinga/Web/Widget/Tabextension/Tabextension.php +++ b/library/Icinga/Web/Widget/Tabextension/Tabextension.php @@ -29,7 +29,7 @@ namespace Icinga\Web\Widget\Tabextension; -use \Icinga\Web\Widget\Tabs; +use Icinga\Web\Widget\Tabs; /** * Tabextension interface that allows to extend a tabbar with reusable components diff --git a/test/php/phpunit.xml b/test/php/phpunit.xml index b5ab5a395..b36e81fe8 100644 --- a/test/php/phpunit.xml +++ b/test/php/phpunit.xml @@ -23,10 +23,16 @@ - - /usr/share/php - /usr/lib - + + ../../application + ../../library/Icinga + ../../modules + + ../../library/Icinga/Application/functions.php + ../../library/Icinga/Application/webrouter.php + ../../library/Icinga/Web/View/helpers + +