mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-31 01:34:09 +02:00
parent
0ca0eef311
commit
34822d9a02
@ -1,19 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Test\Monitoring\Application\Controllers\ListController;
|
namespace Icinga\Modules\Monitoring\Test\Application\Controllers\ListController;
|
||||||
|
|
||||||
|
|
||||||
require_once realpath(__DIR__ . '/../../../../../../library/Icinga/Test/BaseTestCase.php');
|
|
||||||
|
|
||||||
use Icinga\Test\BaseTestCase;
|
use Icinga\Test\BaseTestCase;
|
||||||
|
|
||||||
require_once(realpath(BaseTestCase::$moduleDir . '/monitoring/test/php/testlib/MonitoringControllerTest.php'));
|
|
||||||
require_once(realpath(BaseTestCase::$libDir . '/Data/Db/TreeToSqlParser.php'));
|
|
||||||
require_once(realpath(BaseTestCase::$moduleDir . '/monitoring/library/Monitoring/DataView/DataView.php'));
|
|
||||||
require_once(realpath(BaseTestCase::$moduleDir . '/monitoring/library/Monitoring/DataView/HostStatus.php'));
|
|
||||||
require_once(realpath(BaseTestCase::$moduleDir . '/monitoring/library/Monitoring/DataView/Notification.php'));
|
|
||||||
require_once(realpath(BaseTestCase::$moduleDir . '/monitoring/library/Monitoring/DataView/Downtime.php'));
|
|
||||||
|
|
||||||
use Test\Monitoring\Testlib\MonitoringControllerTest;
|
use Test\Monitoring\Testlib\MonitoringControllerTest;
|
||||||
use Test\Monitoring\Testlib\Datasource\TestFixture;
|
use Test\Monitoring\Testlib\Datasource\TestFixture;
|
||||||
use Test\Monitoring\Testlib\Datasource\ObjectFlags;
|
use Test\Monitoring\Testlib\Datasource\ObjectFlags;
|
||||||
|
@ -30,7 +30,7 @@ class TestInit
|
|||||||
}
|
}
|
||||||
|
|
||||||
$baseNs = 'Icinga\\Module\\' . ucfirst($module);
|
$baseNs = 'Icinga\\Module\\' . ucfirst($module);
|
||||||
$moduleLibraryPath = $modulePath . '/' . $module . '/library';
|
$moduleLibraryPath = $modulePath . '/' . $module . '/library/' . ucfirst($module);
|
||||||
|
|
||||||
if (is_dir($moduleLibraryPath)) {
|
if (is_dir($moduleLibraryPath)) {
|
||||||
$loader->registerNamespace($baseNs, $moduleLibraryPath);
|
$loader->registerNamespace($baseNs, $moduleLibraryPath);
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
*/
|
*/
|
||||||
// {{{ICINGA_LICENSE_HEADER}}}
|
// {{{ICINGA_LICENSE_HEADER}}}
|
||||||
|
|
||||||
namespace Test\Icinga\Form\Config;
|
namespace Icinga\Test\Form\Config;
|
||||||
|
|
||||||
use Icinga\Test\BaseTestCase;
|
use Icinga\Test\BaseTestCase;
|
||||||
|
|
||||||
|
@ -27,32 +27,15 @@
|
|||||||
*/
|
*/
|
||||||
// {{{ICINGA_LICENSE_HEADER}}}
|
// {{{ICINGA_LICENSE_HEADER}}}
|
||||||
|
|
||||||
namespace Test\Icinga\Form\Config;
|
namespace Icinga\Test\Form\Config;
|
||||||
|
|
||||||
// @codingStandardsIgnoreStart
|
|
||||||
require_once realpath(__DIR__ . '/../../../../../library/Icinga/Test/BaseTestCase.php');
|
|
||||||
// @codingStandardsIgnoreEnd
|
|
||||||
|
|
||||||
use Icinga\Test\BaseTestCase;
|
|
||||||
// @codingStandardsIgnoreStart
|
|
||||||
require_once 'Zend/Form.php';
|
|
||||||
require_once 'Zend/Config.php';
|
|
||||||
require_once 'Zend/Config/Ini.php';
|
|
||||||
require_once 'Zend/View/Helper/Abstract.php';
|
|
||||||
require_once BaseTestCase::$libDir . '/Web/Form.php';
|
|
||||||
require_once BaseTestCase::$appDir . '/forms/Config/GeneralForm.php';
|
|
||||||
require_once BaseTestCase::$appDir . '/views/helpers/DateFormat.php';
|
|
||||||
require_once BaseTestCase::$libDir . '/Util/ConfigAwareFactory.php';
|
|
||||||
require_once BaseTestCase::$libDir . '/Util/DateTimeFactory.php';
|
|
||||||
require_once BaseTestCase::$libDir . '/Util/Translator.php';
|
|
||||||
// @codingStandardsIgnoreEnd
|
|
||||||
|
|
||||||
use \DateTimeZone;
|
use \DateTimeZone;
|
||||||
use \DOMDocument;
|
use \DOMDocument;
|
||||||
use \Zend_Config;
|
use \Zend_Config;
|
||||||
use \Zend_View;
|
use \Zend_View;
|
||||||
use \Zend_View_Helper_DateFormat;
|
use \Zend_View_Helper_DateFormat;
|
||||||
use \Icinga\Util\DateTimeFactory;
|
use Icinga\Util\DateTimeFactory;
|
||||||
|
use Icinga\Test\BaseTestCase;
|
||||||
|
|
||||||
class GeneralFormTest extends BaseTestCase
|
class GeneralFormTest extends BaseTestCase
|
||||||
{
|
{
|
||||||
|
@ -27,23 +27,10 @@
|
|||||||
*/
|
*/
|
||||||
// {{{ICINGA_LICENSE_HEADER}}}
|
// {{{ICINGA_LICENSE_HEADER}}}
|
||||||
|
|
||||||
namespace Test\Icinga\Form\Config;
|
namespace Icinga\Test\Form\Config;
|
||||||
|
|
||||||
// @codingStandardsIgnoreStart
|
|
||||||
require_once realpath(__DIR__ . '/../../../../../library/Icinga/Test/BaseTestCase.php');
|
|
||||||
// @codingStandardsIgnoreEnd
|
|
||||||
|
|
||||||
use Icinga\Test\BaseTestCase;
|
|
||||||
// @codingStandardsIgnoreStart
|
|
||||||
require_once 'Zend/Form.php';
|
|
||||||
require_once 'Zend/Config.php';
|
|
||||||
require_once 'Zend/Config/Ini.php';
|
|
||||||
require_once BaseTestCase::$libDir . '/Web/Form.php';
|
|
||||||
require_once BaseTestCase::$appDir . '/forms/Config/GeneralForm.php';
|
|
||||||
require_once BaseTestCase::$appDir . '/forms/Config/LoggingForm.php';
|
|
||||||
// @codingStandardsIgnoreEnd
|
|
||||||
|
|
||||||
use \Zend_Config;
|
use \Zend_Config;
|
||||||
|
Use Icinga\Test\BaseTestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test for the authentication provider form
|
* Test for the authentication provider form
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
*/
|
*/
|
||||||
// {{{ICINGA_LICENSE_HEADER}}}
|
// {{{ICINGA_LICENSE_HEADER}}}
|
||||||
|
|
||||||
namespace Test\Icinga\Form\Preference;
|
namespace Icinga\Test\Form\Preference;
|
||||||
|
|
||||||
// @codingStandardsIgnoreStart
|
// @codingStandardsIgnoreStart
|
||||||
require_once realpath(__DIR__ . '/../../../../../library/Icinga/Test/BaseTestCase.php');
|
require_once realpath(__DIR__ . '/../../../../../library/Icinga/Test/BaseTestCase.php');
|
||||||
|
@ -36,17 +36,6 @@ use Icinga\Chart\GridChart;
|
|||||||
use Icinga\Test\BaseTestCase;
|
use Icinga\Test\BaseTestCase;
|
||||||
use Test\Icinga\LibraryLoader;
|
use Test\Icinga\LibraryLoader;
|
||||||
|
|
||||||
// TODO: Use autoloader #4673
|
|
||||||
require_once realpath(__DIR__ . '/../../../../../library/Icinga/Test/BaseTestCase.php');
|
|
||||||
require_once realpath(BaseTestCase::$testDir . '/library/Icinga/LibraryLoader.php');
|
|
||||||
|
|
||||||
require_once realpath(BaseTestCase::$libDir . '/Chart/Primitive/Drawable.php');
|
|
||||||
require_once realpath(BaseTestCase::$libDir . '/Chart/Primitive/Styleable.php');
|
|
||||||
require_once realpath(BaseTestCase::$libDir . '/Chart/Primitive/Animatable.php');
|
|
||||||
require_once realpath(BaseTestCase::$libDir . '/Chart/Unit/AxisUnit.php');
|
|
||||||
require_once realpath(BaseTestCase::$libDir . '/Chart/Unit/LinearUnit.php');
|
|
||||||
LibraryLoader::loadFolder(realpath(BaseTestCase::$libDir . '/Chart'));
|
|
||||||
|
|
||||||
class GraphChartTest extends BaseTestCase
|
class GraphChartTest extends BaseTestCase
|
||||||
{
|
{
|
||||||
public function testBarChartCreation()
|
public function testBarChartCreation()
|
||||||
|
@ -27,26 +27,14 @@
|
|||||||
*/
|
*/
|
||||||
// {{{ICINGA_LICENSE_HEADER}}}
|
// {{{ICINGA_LICENSE_HEADER}}}
|
||||||
|
|
||||||
namespace Tests\Icinga\Chart;
|
namespace Icinga\Tests\Chart;
|
||||||
|
|
||||||
use DOMXPath;
|
use \DOMXPath;
|
||||||
use DOMDocument;
|
use \DOMDocument;
|
||||||
|
|
||||||
use Icinga\Chart\GridChart;
|
use Icinga\Chart\GridChart;
|
||||||
use Icinga\Chart\PieChart;
|
use Icinga\Chart\PieChart;
|
||||||
use Icinga\Test\BaseTestCase;
|
use Icinga\Test\BaseTestCase;
|
||||||
use Test\Icinga\LibraryLoader;
|
|
||||||
|
|
||||||
// TODO: Use autoloader #4673
|
|
||||||
require_once realpath(__DIR__ . '/../../../../../library/Icinga/Test/BaseTestCase.php');
|
|
||||||
require_once realpath(BaseTestCase::$testDir . '/library/Icinga/LibraryLoader.php');
|
|
||||||
|
|
||||||
require_once realpath(BaseTestCase::$libDir . '/Chart/Primitive/Drawable.php');
|
|
||||||
require_once realpath(BaseTestCase::$libDir . '/Chart/Primitive/Styleable.php');
|
|
||||||
require_once realpath(BaseTestCase::$libDir . '/Chart/Primitive/Animatable.php');
|
|
||||||
require_once realpath(BaseTestCase::$libDir . '/Chart/Unit/AxisUnit.php');
|
|
||||||
require_once realpath(BaseTestCase::$libDir . '/Chart/Unit/LinearUnit.php');
|
|
||||||
LibraryLoader::loadFolder(realpath(BaseTestCase::$libDir . '/Chart'));
|
|
||||||
|
|
||||||
class PieChartTest extends BaseTestCase
|
class PieChartTest extends BaseTestCase
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace Test\Icinga;
|
namespace Icinga\Test;
|
||||||
|
|
||||||
abstract class LibraryLoader {
|
abstract class LibraryLoader {
|
||||||
|
|
||||||
|
@ -1,59 +0,0 @@
|
|||||||
<?php
|
|
||||||
// {{{ICINGA_LICENSE_HEADER}}}
|
|
||||||
/**
|
|
||||||
* This file is part of Icinga Web 2.
|
|
||||||
*
|
|
||||||
* Icinga Web 2 - Head for multiple monitoring backends.
|
|
||||||
* Copyright (C) 2013 Icinga Development Team
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU General Public License
|
|
||||||
* as published by the Free Software Foundation; either version 2
|
|
||||||
* of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
*
|
|
||||||
* @copyright 2013 Icinga Development Team <info@icinga.org>
|
|
||||||
* @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
|
|
||||||
* @author Icinga Development Team <info@icinga.org>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
// {{{ICINGA_LICENSE_HEADER}}}
|
|
||||||
|
|
||||||
namespace Tests\Icinga\Protocol\Commandpipe;
|
|
||||||
|
|
||||||
require_once('./library/Icinga/LibraryLoader.php');
|
|
||||||
|
|
||||||
use Test\Icinga\LibraryLoader;
|
|
||||||
|
|
||||||
class CommandPipeLoader extends LibraryLoader {
|
|
||||||
|
|
||||||
public static function requireLibrary()
|
|
||||||
{
|
|
||||||
require_once('Zend/Config.php');
|
|
||||||
require_once('Zend/Log.php');
|
|
||||||
require_once(realpath('../../library/Icinga/Application/Logger.php'));
|
|
||||||
require_once(realpath('../../library/Icinga/Protocol/Commandpipe/Command.php'));
|
|
||||||
require_once(realpath('../../library/Icinga/Protocol/Commandpipe/Comment.php'));
|
|
||||||
require_once(realpath('../../library/Icinga/Protocol/Commandpipe/CommandPipe.php'));
|
|
||||||
require_once(realpath('../../library/Icinga/Protocol/Commandpipe/PropertyModifier.php'));
|
|
||||||
require_once(realpath('../../library/Icinga/Protocol/Commandpipe/Exception/InvalidCommandException.php'));
|
|
||||||
require_once(realpath('../../library/Icinga/Protocol/Commandpipe/Transport/Transport.php'));
|
|
||||||
require_once(realpath('../../library/Icinga/Protocol/Commandpipe/Transport/SecureShell.php'));
|
|
||||||
require_once(realpath('../../library/Icinga/Protocol/Commandpipe/Transport/LocalPipe.php'));
|
|
||||||
require_once(realpath('../../modules/monitoring/library/Monitoring/Command/AcknowledgeCommand.php'));
|
|
||||||
require_once(realpath('../../modules/monitoring/library/Monitoring/Command/AddCommentCommand.php'));
|
|
||||||
require_once(realpath('../../modules/monitoring/library/Monitoring/Command/ScheduleDowntimeCommand.php'));
|
|
||||||
require_once(realpath('../../modules/monitoring/library/Monitoring/Command/CustomNotificationCommand.php'));
|
|
||||||
require_once(realpath('../../modules/monitoring/library/Monitoring/Command/DelayNotificationCommand.php'));
|
|
||||||
require_once(realpath('../../modules/monitoring/library/Monitoring/Command/ScheduleCheckCommand.php'));
|
|
||||||
require_once(realpath('../../modules/monitoring/library/Monitoring/Command/SubmitPassiveCheckresultCommand.php'));
|
|
||||||
}
|
|
||||||
}
|
|
@ -27,13 +27,10 @@
|
|||||||
*/
|
*/
|
||||||
// {{{ICINGA_LICENSE_HEADER}}}
|
// {{{ICINGA_LICENSE_HEADER}}}
|
||||||
|
|
||||||
namespace Tests\Icinga\Protocol\Commandpipe;
|
namespace Icinga\Tests\Protocol\Commandpipe;
|
||||||
|
|
||||||
require_once(realpath(__DIR__ . '/CommandPipeLoader.php'));
|
use \Zend_Config;
|
||||||
CommandPipeLoader::requireLibrary();
|
use \PHPUnit_Framework_TestCase;
|
||||||
|
|
||||||
use Zend_Config;
|
|
||||||
use PHPUnit_Framework_TestCase;
|
|
||||||
use Icinga\Protocol\Commandpipe\Comment;
|
use Icinga\Protocol\Commandpipe\Comment;
|
||||||
use Icinga\Protocol\Commandpipe\Commandpipe as Commandpipe;
|
use Icinga\Protocol\Commandpipe\Commandpipe as Commandpipe;
|
||||||
use Icinga\Protocol\Commandpipe\PropertyModifier as MONFLAG;
|
use Icinga\Protocol\Commandpipe\PropertyModifier as MONFLAG;
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Tests\Icinga\Protocol\Statusdat;
|
namespace Tests\Icinga\Protocol\Statusdat;
|
||||||
require_once("Zend/Config.php");;
|
|
||||||
require_once("Zend/Log.php");;
|
|
||||||
|
|
||||||
use \Icinga\Protocol\Statusdat as SD;
|
use \Icinga\Protocol\Statusdat as SD;
|
||||||
|
|
||||||
@ -13,8 +11,6 @@ use \Icinga\Protocol\Statusdat as SD;
|
|||||||
class StatusdatComponentTest extends \PHPUnit_Framework_TestCase
|
class StatusdatComponentTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
public function getReader() {
|
public function getReader() {
|
||||||
require_once(dirname(__FILE__)."/../StatusdatTestLoader.php");
|
|
||||||
StatusdatTestLoader::requireLibrary();
|
|
||||||
$reader = new SD\Reader(new \Zend_Config(array(
|
$reader = new SD\Reader(new \Zend_Config(array(
|
||||||
"status_file" => dirname(__FILE__)."/status.dat",
|
"status_file" => dirname(__FILE__)."/status.dat",
|
||||||
"object_file" => dirname(__FILE__)."/objects.cache"
|
"object_file" => dirname(__FILE__)."/objects.cache"
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Tests\Icinga\Protocol\Statusdat;
|
namespace Tests\Icinga\Protocol\Statusdat;
|
||||||
require_once(realpath("../../library/Icinga/Protocol/Statusdat/Exception/ParsingException.php"));
|
|
||||||
require_once(realpath("../../library/Icinga/Exception/ProgrammingError.php"));
|
|
||||||
require_once(realpath("../../library/Icinga/Protocol/Statusdat/Parser.php"));
|
|
||||||
use Icinga\Protocol\Statusdat\Parser;
|
use Icinga\Protocol\Statusdat\Parser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Test class for Parser
|
* Test class for Parser
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Tests\Icinga\Protocol\Statusdat\Query;
|
namespace Icinga\Tests\Protocol\Statusdat\Query;
|
||||||
|
|
||||||
require_once("../../library/Icinga/Protocol/Statusdat/Query/IQueryPart.php");
|
|
||||||
require_once("../../library/Icinga/Protocol/Statusdat/Query/Expression.php");
|
|
||||||
|
|
||||||
use Icinga\Protocol\Statusdat\Query\Expression;
|
use Icinga\Protocol\Statusdat\Query\Expression;
|
||||||
|
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Tests\Icinga\Protocol\Statusdat\Query;
|
namespace Icinga\Tests\Protocol\Statusdat\Query;
|
||||||
require_once("../../library/Icinga/Protocol/Statusdat/Query/IQueryPart.php");
|
|
||||||
require_once("../../library/Icinga/Protocol/Statusdat/Query/Group.php");
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -50,7 +48,7 @@ class GroupTest extends \PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
$testQuery = new Statusdat\Query\Group();
|
$testQuery = new Statusdat\Query\Group();
|
||||||
$value = array(4);
|
$value = array(4);
|
||||||
$testQuery->fromString("numeric_val >= ?", $value, "Tests\Icinga\Protocol\Statusdat\Query\QueryExpressionMock");
|
$testQuery->fromString("numeric_val >= ?", $value, "Icinga\Tests\Protocol\Statusdat\Query\QueryExpressionMock");
|
||||||
$this->assertCount(1, $testQuery->getItems());
|
$this->assertCount(1, $testQuery->getItems());
|
||||||
$this->assertCount(0, $value);
|
$this->assertCount(0, $value);
|
||||||
|
|
||||||
@ -66,7 +64,7 @@ class GroupTest extends \PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
$testQuery = new Statusdat\Query\Group();
|
$testQuery = new Statusdat\Query\Group();
|
||||||
$value = array(4, 'hosta');
|
$value = array(4, 'hosta');
|
||||||
$testQuery->fromString("numeric_val >= ? AND host_name = ?", $value, "Tests\Icinga\Protocol\Statusdat\Query\QueryExpressionMock");
|
$testQuery->fromString("numeric_val >= ? AND host_name = ?", $value, "Icinga\Tests\Protocol\Statusdat\Query\QueryExpressionMock");
|
||||||
$this->assertCount(2, $testQuery->getItems());
|
$this->assertCount(2, $testQuery->getItems());
|
||||||
$this->assertCount(0, $value);
|
$this->assertCount(0, $value);
|
||||||
$this->assertEquals("AND", $testQuery->getType());
|
$this->assertEquals("AND", $testQuery->getType());
|
||||||
@ -85,7 +83,7 @@ class GroupTest extends \PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
$testQuery = new Statusdat\Query\Group();
|
$testQuery = new Statusdat\Query\Group();
|
||||||
$value = array(4, 'hosta');
|
$value = array(4, 'hosta');
|
||||||
$testQuery->fromString("numeric_val >= ? OR host_name = ?", $value, "Tests\Icinga\Protocol\Statusdat\Query\QueryExpressionMock");
|
$testQuery->fromString("numeric_val >= ? OR host_name = ?", $value, "Icinga\Tests\Protocol\Statusdat\Query\QueryExpressionMock");
|
||||||
$this->assertCount(2, $testQuery->getItems());
|
$this->assertCount(2, $testQuery->getItems());
|
||||||
$this->assertCount(0, $value);
|
$this->assertCount(0, $value);
|
||||||
$this->assertEquals("OR", $testQuery->getType());
|
$this->assertEquals("OR", $testQuery->getType());
|
||||||
@ -104,7 +102,7 @@ class GroupTest extends \PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
$testQuery = new Statusdat\Query\Group();
|
$testQuery = new Statusdat\Query\Group();
|
||||||
$value = array(4, 'service1', 'hosta');
|
$value = array(4, 'service1', 'hosta');
|
||||||
$testQuery->fromString("numeric_val >= ? AND (service_description = ? OR host_name = ?)", $value, "Tests\Icinga\Protocol\Statusdat\Query\QueryExpressionMock");
|
$testQuery->fromString("numeric_val >= ? AND (service_description = ? OR host_name = ?)", $value, "Icinga\Tests\Protocol\Statusdat\Query\QueryExpressionMock");
|
||||||
$this->assertCount(2, $testQuery->getItems());
|
$this->assertCount(2, $testQuery->getItems());
|
||||||
$this->assertCount(0, $value);
|
$this->assertCount(0, $value);
|
||||||
$this->assertEquals("AND", $testQuery->getType());
|
$this->assertEquals("AND", $testQuery->getType());
|
||||||
@ -132,7 +130,7 @@ class GroupTest extends \PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
$testQuery = new Statusdat\Query\Group();
|
$testQuery = new Statusdat\Query\Group();
|
||||||
$value = array(4, 'service1', 'hosta');
|
$value = array(4, 'service1', 'hosta');
|
||||||
$testQuery->fromString("numeric_val >= ? AND service_description = ? OR host_name = ?", $value, "Tests\Icinga\Protocol\Statusdat\Query\QueryExpressionMock");
|
$testQuery->fromString("numeric_val >= ? AND service_description = ? OR host_name = ?", $value, "Icinga\Tests\Protocol\Statusdat\Query\QueryExpressionMock");
|
||||||
$this->assertCount(2, $testQuery->getItems());
|
$this->assertCount(2, $testQuery->getItems());
|
||||||
$this->assertCount(0, $value);
|
$this->assertCount(0, $value);
|
||||||
$this->assertEquals("AND", $testQuery->getType());
|
$this->assertEquals("AND", $testQuery->getType());
|
||||||
|
@ -1,10 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Tests\Icinga\Protocol\Statusdat;
|
namespace Icinga\Tests\Protocol\Statusdat;
|
||||||
require_once('../../library/Icinga/Filter/Filterable.php');
|
|
||||||
require_once('../../library/Icinga/Data/BaseQuery.php');
|
|
||||||
require_once('../../library/Icinga/Protocol/Statusdat/Query.php');
|
|
||||||
require_once(dirname(__FILE__)."/ReaderMock.php");
|
|
||||||
|
|
||||||
use Icinga\Protocol\Statusdat as Statusdat;
|
use Icinga\Protocol\Statusdat as Statusdat;
|
||||||
|
|
||||||
@ -93,6 +89,7 @@ class QueryTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
private function getServiceTestReader()
|
private function getServiceTestReader()
|
||||||
{
|
{
|
||||||
|
require_once('ReaderMock.php');
|
||||||
$readerMock = new ReaderMock(array(
|
$readerMock = new ReaderMock(array(
|
||||||
"host" => array(
|
"host" => array(
|
||||||
"hosta" => (object) array(
|
"hosta" => (object) array(
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace Tests\Icinga\Protocol\Statusdat;
|
namespace Icinga\Tests\Protocol\Statusdat;
|
||||||
require_once("../../library/Icinga/Protocol/Statusdat/IReader.php");
|
|
||||||
require_once(realpath("../../library/Icinga/Data/DatasourceInterface.php"));
|
|
||||||
use Icinga\Data\DatasourceInterface;
|
use Icinga\Data\DatasourceInterface;
|
||||||
use Icinga\Protocol\Statusdat\IReader;
|
use Icinga\Protocol\Statusdat\IReader;
|
||||||
|
|
||||||
|
@ -1,13 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Tests\Icinga\Protocol\Statusdat;
|
namespace Icinga\Tests\Protocol\Statusdat;
|
||||||
|
|
||||||
require_once("StatusdatTestLoader.php");
|
|
||||||
|
|
||||||
use Icinga\Protocol\Statusdat\Reader as Reader;
|
use Icinga\Protocol\Statusdat\Reader as Reader;
|
||||||
|
|
||||||
StatusdatTestLoader::requireLibrary();
|
|
||||||
|
|
||||||
if (!defined('APPLICATION_PATH')) {
|
if (!defined('APPLICATION_PATH')) {
|
||||||
define("APPLICATION_PATH", "./"); // TODO: test boostrap
|
define("APPLICATION_PATH", "./"); // TODO: test boostrap
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Tests\Icinga\Protocol\Statusdat;
|
namespace Icinga\Tests\Protocol\Statusdat;
|
||||||
|
|
||||||
require_once("../../library/Icinga/Protocol/Statusdat/RuntimeStateContainer.php");
|
|
||||||
|
|
||||||
class RuntimestatecontainerTest extends \PHPUnit_Framework_TestCase
|
class RuntimestatecontainerTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
|
@ -1,37 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Tests\Icinga\Protocol\Statusdat;
|
|
||||||
|
|
||||||
use Test\Icinga\LibraryLoader;
|
|
||||||
|
|
||||||
require_once(realpath(dirname(__FILE__) . '/../../LibraryLoader.php'));
|
|
||||||
|
|
||||||
class StatusdatTestLoader extends LibraryLoader
|
|
||||||
{
|
|
||||||
public static function requireLibrary()
|
|
||||||
{
|
|
||||||
$libPath = LibraryLoader::getLibraryPath();
|
|
||||||
require_once 'Zend/Config.php';
|
|
||||||
require_once 'Zend/Cache.php';
|
|
||||||
require_once 'Zend/Log.php';
|
|
||||||
require_once($libPath . '/Data/BaseQuery.php');
|
|
||||||
require_once($libPath . '/Application/Logger.php');
|
|
||||||
require_once($libPath . '/Filter/Filterable.php');
|
|
||||||
require_once($libPath . '/Data/DatasourceInterface.php');
|
|
||||||
$statusdat = realpath($libPath . '/Protocol/Statusdat/');
|
|
||||||
require_once($statusdat . '/View/AccessorStrategy.php');
|
|
||||||
require_once($statusdat . '/PrintableObject.php');
|
|
||||||
require_once($statusdat . '/View/MonitoringObjectList.php');
|
|
||||||
require_once($statusdat . '/ObjectContainer.php');
|
|
||||||
require_once($statusdat . '/IReader.php');
|
|
||||||
require_once($statusdat . '/RuntimeStateContainer.php');
|
|
||||||
require_once($statusdat . '/Query.php');
|
|
||||||
require_once($statusdat . '/Parser.php');
|
|
||||||
require_once($statusdat . '/Reader.php');
|
|
||||||
require_once($statusdat . '/TreeToStatusdatQueryParser.php');
|
|
||||||
require_once($statusdat . '/Exception/ParsingException.php');
|
|
||||||
require_once($statusdat . '/Query/IQueryPart.php');
|
|
||||||
require_once($statusdat . '/Query/Expression.php');
|
|
||||||
require_once($statusdat . '/Query/Group.php');
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Test\Icinga\Web\Form\Element;
|
namespace Icinga\Test\Web\Form\Element;
|
||||||
use Icinga\Test\BaseTestCase;
|
use Icinga\Test\BaseTestCase;
|
||||||
|
|
||||||
require_once 'Zend/Form/Element/Text.php';
|
require_once 'Zend/Form/Element/Text.php';
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
*/
|
*/
|
||||||
// {{{ICINGA_LICENSE_HEADER}}}
|
// {{{ICINGA_LICENSE_HEADER}}}
|
||||||
|
|
||||||
namespace Test\Icinga\Web\Form\Validator;
|
namespace Icinga\Test\Web\Form\Validator;
|
||||||
|
|
||||||
require_once('Zend/Validate/Abstract.php');
|
require_once('Zend/Validate/Abstract.php');
|
||||||
require_once(realpath('../../library/Icinga/Web/Form/Validator/DateFormatValidator.php'));
|
require_once(realpath('../../library/Icinga/Web/Form/Validator/DateFormatValidator.php'));
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
*/
|
*/
|
||||||
// {{{ICINGA_LICENSE_HEADER}}}
|
// {{{ICINGA_LICENSE_HEADER}}}
|
||||||
|
|
||||||
namespace Test\Icinga\Web\Form\Validator;
|
namespace Icinga\Test\Web\Form\Validator;
|
||||||
|
|
||||||
require_once('Zend/Validate/Abstract.php');
|
require_once('Zend/Validate/Abstract.php');
|
||||||
require_once(realpath('../../library/Icinga/Web/Form/Validator/TimeFormatValidator.php'));
|
require_once(realpath('../../library/Icinga/Web/Form/Validator/TimeFormatValidator.php'));
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
*/
|
*/
|
||||||
// {{{ICINGA_LICENSE_HEADER}}}
|
// {{{ICINGA_LICENSE_HEADER}}}
|
||||||
|
|
||||||
namespace Test\Icinga\Web\Form\Validator;
|
namespace Icinga\Test\Web\Form\Validator;
|
||||||
|
|
||||||
require_once('Zend/Validate/Abstract.php');
|
require_once('Zend/Validate/Abstract.php');
|
||||||
require_once(realpath('../../library/Icinga/Web/Form/Validator/WritablePathValidator.php'));
|
require_once(realpath('../../library/Icinga/Web/Form/Validator/WritablePathValidator.php'));
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Tests\Icinga\Web\Paginator\Adapter;
|
namespace Icinga\Tests\Web\Paginator\Adapter;
|
||||||
|
|
||||||
use PHPUnit_Framework_TestCase;
|
use PHPUnit_Framework_TestCase;
|
||||||
use Zend_Config;
|
use Zend_Config;
|
||||||
@ -9,19 +9,6 @@ use Icinga\Web\Paginator\Adapter\QueryAdapter;
|
|||||||
use Icinga\Module\Monitoring\Backend;
|
use Icinga\Module\Monitoring\Backend;
|
||||||
use Tests\Icinga\Protocol\Statusdat\StatusdatTestLoader;
|
use Tests\Icinga\Protocol\Statusdat\StatusdatTestLoader;
|
||||||
|
|
||||||
require_once 'Zend/Paginator/Adapter/Interface.php';
|
|
||||||
|
|
||||||
require_once '../../library/Icinga/Web/Paginator/Adapter/QueryAdapter.php';
|
|
||||||
require_once 'library/Icinga/Protocol/Statusdat/StatusdatTestLoader.php';
|
|
||||||
StatusdatTestLoader::requireLibrary();
|
|
||||||
|
|
||||||
require_once '../../modules/monitoring/library/Monitoring/Backend/Statusdat/Query/StatusdatQuery.php';
|
|
||||||
require_once '../../modules/monitoring/library/Monitoring/Backend/Statusdat/Query/StatusQuery.php';
|
|
||||||
require_once '../../modules/monitoring/library/Monitoring/Backend.php';
|
|
||||||
|
|
||||||
require_once '../../library/Icinga/Data/BaseQuery.php';
|
|
||||||
require_once '../../library/Icinga/Data/ResourceFactory.php';
|
|
||||||
|
|
||||||
class QueryAdapterTest extends PHPUnit_Framework_TestCase
|
class QueryAdapterTest extends PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
private $cacheDir;
|
private $cacheDir;
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Tests\Icinga\Web\Paginator\ScrollingStyle;
|
namespace Icinga\Tests\Web\Paginator\ScrollingStyle;
|
||||||
|
|
||||||
|
require_once('Icinga/Web/Paginator/ScrollingStyle/SlidingWithBorder.php');
|
||||||
|
|
||||||
use Zend_Config;
|
use Zend_Config;
|
||||||
use Zend_Paginator_Adapter_Interface;
|
use Zend_Paginator_Adapter_Interface;
|
||||||
@ -10,22 +12,6 @@ use Icinga\Web\Paginator\Adapter\QueryAdapter;
|
|||||||
use Tests\Icinga\Protocol\Statusdat\StatusdatTestLoader;
|
use Tests\Icinga\Protocol\Statusdat\StatusdatTestLoader;
|
||||||
use Icinga\Module\Monitoring\Backend;
|
use Icinga\Module\Monitoring\Backend;
|
||||||
|
|
||||||
require_once 'Zend/Paginator/Adapter/Interface.php';
|
|
||||||
require_once 'Zend/Paginator/ScrollingStyle/Interface.php';
|
|
||||||
require_once 'Zend/Paginator.php';
|
|
||||||
require_once 'Zend/Config.php';
|
|
||||||
require_once 'Zend/Cache.php';
|
|
||||||
|
|
||||||
require_once '../../library/Icinga/Web/Paginator/Adapter/QueryAdapter.php';
|
|
||||||
require_once 'library/Icinga/Protocol/Statusdat/StatusdatTestLoader.php';
|
|
||||||
|
|
||||||
StatusdatTestLoader::requireLibrary();
|
|
||||||
|
|
||||||
require_once '../../modules/monitoring/library/Monitoring/Backend.php';
|
|
||||||
require_once '../../modules/monitoring/library/Monitoring/Backend/Statusdat/Query/StatusdatQuery.php';
|
|
||||||
require_once '../../modules/monitoring/library/Monitoring/Backend/Statusdat/Query/StatusQuery.php';
|
|
||||||
require_once '../../library/Icinga/Web/Paginator/ScrollingStyle/SlidingWithBorder.php';
|
|
||||||
|
|
||||||
class TestPaginatorAdapter implements Zend_Paginator_Adapter_Interface
|
class TestPaginatorAdapter implements Zend_Paginator_Adapter_Interface
|
||||||
{
|
{
|
||||||
private $items = array();
|
private $items = array();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user