Mark less important or non-testable code as skipped for code coverage

refs #6011
This commit is contained in:
Johannes Meyer 2014-04-28 14:03:52 +02:00
parent 1df56cbfb9
commit 98ca15d1fb
64 changed files with 159 additions and 87 deletions

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
namespace Icinga\Clicommands;
@ -117,3 +118,4 @@ class AutocompleteCommand extends Command
}
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
namespace Icinga\Clicommands;
@ -40,3 +41,4 @@ class HelpCommand extends Command
);
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
namespace Icinga\Clicommands;
@ -211,3 +212,4 @@ class ModuleCommand extends Command
$this->fail("Not implemented yet");
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
namespace Icinga\Clicommands;
@ -80,3 +81,4 @@ class WebCommand extends Command
}
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -138,3 +139,4 @@ class AuthenticationController extends ActionController
}
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -556,3 +557,4 @@ class ConfigController extends BaseConfigController
}
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,5 +1,5 @@
<?php
// @codingStandardsIgnoreStart
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -142,4 +142,4 @@ class DashboardController extends ActionController
$this->view->dashboard = $dashboard;
}
}
// @codingStandardsIgnoreEnd
// @codeCoverageIgnoreEnd

View File

@ -1,5 +1,5 @@
<?php
// @codingStandardsIgnoreStart
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -77,4 +77,4 @@ class ErrorController extends ActionController
$this->view->request = $error->request;
}
}
// @codingStandardsIgnoreEnd
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -26,7 +27,6 @@
*
*/
// {{{ICINGA_LICENSE_HEADER}}}
// @codingStandardsIgnoreStart
use Icinga\Web\Controller\ActionController;
use Icinga\Filter\Filter;
@ -117,4 +117,4 @@ class FilterController extends ActionController
}
}
}
// @codingStandardsIgnoreEnd
// @codeCoverageIgnoreEnd

View File

@ -1,5 +1,5 @@
<?php
// @codingStandardsIgnoreStart
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -61,4 +61,4 @@ class IndexController extends ActionController
{
}
}
// @codingStandardsIgnoreEnd
// @codeCoverageIgnoreEnd

View File

@ -1,5 +1,5 @@
<?php
// @codingStandardsIgnoreStart
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
// {{{ICINGA_LICENSE_HEADER}}}
@ -43,4 +43,4 @@ class LayoutController extends ActionController
$this->renderScript('parts/topbar.phtml');
}
}
// @codingStandardsIgnoreEnd
// @codeCoverageIgnoreEnd

View File

@ -1,5 +1,5 @@
<?php
// @codingStandardsIgnoreStart
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -79,4 +79,4 @@ class ListController extends Controller
}
}
}
// @codingStandardsIgnoreEnd
// @codeCoverageIgnoreEnd

View File

@ -1,5 +1,5 @@
<?php
// @codingStandardsIgnoreStart
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -83,4 +83,4 @@ class PreferenceController extends BasePreferenceController
$this->view->form = $form;
}
}
// @codingStandardsIgnoreEnd
// @codeCoverageIgnoreEnd

View File

@ -1,10 +1,5 @@
<?php
/**
* Icinga (http://www.icinga.org)
*
* @copyright 2014 Icinga Development Team <info@icinga.org>
* @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

View File

@ -1,5 +1,5 @@
<?php
// @codingStandardsIgnoreStart
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -185,4 +185,4 @@ class StaticController extends ActionController
$lessCompiler->printStack();
}
}
// @codingStandardsIgnoreEnd
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -76,3 +77,4 @@ class LoginForm extends Form
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -92,3 +93,4 @@ class ConfirmRemovalForm extends Form
);
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -439,3 +440,4 @@ class GeneralForm extends Form
return $cfg;
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -212,3 +213,4 @@ class LoggingForm extends Form
return new Zend_Config($cfg);
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -29,7 +30,7 @@
namespace Icinga\Form\Dashboard;
use \Icinga\Application\Config as IcingaConfig;
use Icinga\Application\Config as IcingaConfig;
use Icinga\Web\Form;
use Icinga\Web\Widget\Dashboard;
use Zend_Form_Element_Text;
@ -39,7 +40,6 @@ use Zend_Form_Element_Select;
/**
* Form to add an url a dashboard pane
*
*/
class AddUrlForm extends Form
{
@ -51,7 +51,6 @@ class AddUrlForm extends Form
*/
private function addPaneSelectionBox(Dashboard $dashboard)
{
$selectPane = new Zend_Form_Element_Select(
'pane',
array(
@ -84,7 +83,6 @@ class AddUrlForm extends Form
/**
* Add a textfield for creating a new pane to this form
*
*/
private function addNewPaneTextField($showExistingButton = true)
{
@ -130,7 +128,6 @@ class AddUrlForm extends Form
/**
* Add elements to this form (used by extending classes)
*
*/
protected function create()
{
@ -167,6 +164,6 @@ class AddUrlForm extends Form
)
);
$this->setSubmitLabel("Add To Dashboard");
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -285,3 +286,4 @@ class GeneralForm extends Form
);
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,6 +1,5 @@
<?php
// @codingStandardsIgnoreStart
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -95,5 +94,4 @@ class Zend_View_Helper_FormDateTime extends Zend_View_Helper_FormElement
return $xhtml;
}
}
// @codingStandardsIgnoreStop
// @codeCoverageIgnoreEnd

View File

@ -1,6 +1,5 @@
<?php
// @codingStandardsIgnoreStart
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -55,5 +54,4 @@ class Zend_View_Helper_FormNumber extends \Zend_View_Helper_FormText
. $this->getClosingBracket();
}
}
// @codingStandardsIgnoreStop
// @codeCoverageIgnoreEnd

View File

@ -1,6 +1,5 @@
<?php
// @codingStandardsIgnoreStart
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -64,3 +63,4 @@ class Zend_View_Helper_FormTriStateCheckbox extends Zend_View_Helper_FormElement
return $xhtml . '</div>';
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -487,3 +488,4 @@ abstract class ApplicationBootstrap
return $this;
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -317,3 +318,4 @@ class Benchmark
{
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -183,3 +184,4 @@ class Cli extends ApplicationBootstrap
throw new ProgrammingError('Icinga is not running on CLI');
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -61,3 +62,4 @@ class EmbeddedWeb extends ApplicationBootstrap
->loadEnabledModules();
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -55,3 +56,4 @@ class LegacyWeb extends Web
return $this->legacyBasedir;
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -92,3 +93,4 @@ class Platform
}
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -371,3 +372,4 @@ class Web extends ApplicationBootstrap
return $this;
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
namespace Icinga\File;
@ -215,3 +216,4 @@ class Pdf extends DOMPDF
// }
}
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
// {{{ICINGA_LICENSE_HEADER}}}
@ -106,3 +107,4 @@ class SyslogWriter extends LogWriter
closelog();
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,8 +1,9 @@
<?php
// @codeCoverageIgnoreStart
namespace Icinga\User;
use \Zend_Log;
use Zend_Log;
/**
* Class Message
@ -55,3 +56,4 @@ class Message
return $this->level;
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
// {{{ICINGA_LICENSE_HEADER}}}
@ -11,4 +12,5 @@ class File
fclose(fopen($filename, 'a'));
chmod($filename, $mode);
}
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -464,3 +465,4 @@ class ActionController extends Zend_Controller_Action
return parent::__call($name, $params);
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -29,7 +30,7 @@
namespace Icinga\Web\Controller;
use \Zend_Log;
use Zend_Log;
use Icinga\Web\Session;
use Icinga\User\Message;
use Icinga\Authentication\Manager as AuthenticationManager;
@ -95,3 +96,4 @@ class BaseConfigController extends ActionController
$this->view->tabs = ControllerTabCollector::collectControllerTabs('ConfigController');
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -91,3 +92,4 @@ class BasePreferenceController extends ActionController
$store->save($currentPreferences);
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -29,18 +30,16 @@
namespace Icinga\Web\Controller;
use \Icinga\Application\Modules\Module;
use \Icinga\Application\Icinga;
use \Icinga\Web\Widget\Tabs;
use Icinga\Application\Modules\Module;
use Icinga\Application\Icinga;
use Icinga\Web\Widget\Tabs;
/**
* Static helper class that collects tabs provided by the 'createProvidedTabs' method
* of controllers.
*
*/
class ControllerTabCollector
{
/**
* Scan all controllers with the provided name
* in the application and (loaded) module folders and collects their provided tabs
@ -124,3 +123,4 @@ class ControllerTabCollector
return array();
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -103,3 +104,4 @@ class BootstrapForm extends Zend_Form_Decorator_Abstract
. '</div>';
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -59,3 +60,4 @@ class ConditionalHidden extends Zend_Form_Decorator_Abstract
return $content;
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -29,7 +30,7 @@
namespace Icinga\Web\Form\Decorator;
use \Zend_Form_Decorator_Abstract;
use Zend_Form_Decorator_Abstract;
/**
* Decorator that automatically adds a helptext to an input element
@ -60,3 +61,4 @@ class HelpText extends Zend_Form_Decorator_Abstract
return $content;
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -112,3 +113,4 @@ class Grapher
throw new Exception('This backend has no images');
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
/**
* Icinga Web Ticket Hook
@ -42,3 +43,4 @@ abstract class Ticket
abstract public function createLink($match);
}
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
namespace Icinga\Web;
@ -83,3 +84,4 @@ class JavaScript
echo $out;
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -194,3 +195,4 @@ class LessCompiler
}
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -64,3 +65,4 @@ class Request extends Zend_Controller_Request_Http
return $this->user;
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -78,3 +79,4 @@ class Session
return self::$session;
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
namespace Icinga\Web;
@ -67,3 +68,4 @@ class StyleSheet
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -205,3 +206,4 @@ class View extends Zend_View_Abstract
}
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
/**
* Web widget class
@ -50,4 +51,4 @@ class Widget
return $widget;
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,8 +1,6 @@
<?php
// @codeCoverageIgnoreStart
/**
* Web Widget abstract class
*/
namespace Icinga\Web\Widget;
use Icinga\Exception\ProgrammingError;
@ -124,3 +122,4 @@ abstract class AbstractWidget
return (string) $html;
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,10 +1,11 @@
<?php
// @codeCoverageIgnoreStart
namespace Icinga\Web\Widget;
use \Zend_Log;
use \Zend_Form;
use \Zend_View_Abstract;
use Zend_Log;
use Zend_Form;
use Zend_View_Abstract;
use Icinga\User;
use Icinga\User\Message;
use Icinga\Web\Session;
@ -129,3 +130,4 @@ class AlertMessageBox implements \Icinga\Web\Widget\Widget
return $html;
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -343,3 +344,4 @@ class HistoryColorGrid extends AbstractWidget {
return $this->renderVertical($grid);
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -231,4 +232,4 @@ EOD;
return $template;
}
}
// @codeCoverageIgnoreEnd

View File

@ -38,7 +38,6 @@ use Icinga\Web\Widget\AbstractWidget;
use Icinga\Web\Widget\Dashboard\Pane;
use Icinga\Web\Widget\Dashboard\Component as DashboardComponent;
use Icinga\Web\Url;
use Zend_View_Abstract;
/**
* Dashboards display multiple views on a single page

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -185,3 +186,4 @@ EOT;
return $this->nodeToBadge(Tree::normalizeTree($this->tree->root));
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -116,3 +117,4 @@ EOT;
return str_replace('{{BADGES}}', $badges->render($view), $html);
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -29,11 +30,10 @@
namespace Icinga\Web\Widget;
use Zend_Form_Element_Submit;
use Icinga\Web\Form;
use Icinga\Web\Request;
use Zend_View_Abstract;
use Icinga\Web\Form\Decorator\ConditionalHidden;
use Zend_Form_Element_Submit;
/**
* Sortbox widget
@ -174,3 +174,4 @@ class SortBox extends AbstractWidget
return $form;
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -29,8 +30,8 @@
namespace Icinga\Web\Widget\Tabextension;
use \Icinga\Web\Widget\Tabs;
use \Icinga\Web\Url;
use Icinga\Web\Widget\Tabs;
use Icinga\Web\Url;
/**
* Tabextension that adds the basket command
@ -58,3 +59,4 @@ class BasketAction implements Tabextension
);
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -29,10 +30,8 @@
namespace Icinga\Web\Widget\Tabextension;
use \Icinga\Web\Url;
use \Icinga\Config\Config as IcingaConfig;
use \Icinga\Web\Widget\Tabs;
use \Icinga\Web\Widget\Dashboard;
use Icinga\Web\Url;
use Icinga\Web\Widget\Tabs;
/**
* Tabextension that allows to add the current URL to a dashboard
@ -61,3 +60,4 @@ class DashboardAction implements Tabextension
);
}
}
// @codeCoverageIgnoreEnd

View File

@ -1,4 +1,5 @@
<?php
// @codeCoverageIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga Web 2.
@ -29,10 +30,9 @@
namespace Icinga\Web\Widget\Tabextension;
use \Icinga\Logger\Logger;
use \Icinga\Web\Widget\Tab;
use \Icinga\Web\Widget\Tabs;
use \Icinga\Web\Url;
use Icinga\Web\Url;
use Icinga\Web\Widget\Tab;
use Icinga\Web\Widget\Tabs;
/**
* Tabextension that offers different output formats for the user in the dropdown area
@ -97,24 +97,17 @@ class OutputFormat implements Tabextension
* is added, so this class offers to remove specific types instead of adding ones
*
* @param array $disabled An array of output types to <b>not</b> 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

View File

@ -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

View File

@ -23,10 +23,16 @@
</testsuite>
</testsuites>
<filter>
<blacklist>
<directory suffix=".php">/usr/share/php</directory>
<directory suffix=".php">/usr/lib</directory>
</blacklist>
<whitelist addUncoveredFilesFromWhitelist="true">
<directory suffix=".php">../../application</directory>
<directory suffix=".php">../../library/Icinga</directory>
<directory suffix=".php">../../modules</directory>
<exclude>
<file>../../library/Icinga/Application/functions.php</file>
<file>../../library/Icinga/Application/webrouter.php</file>
<directory>../../library/Icinga/Web/View/helpers</directory>
</exclude>
</whitelist>
</filter>
<listeners>
<listener class="\Mockery\Adapter\Phpunit\TestListener"></listener>