mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-26 07:14:35 +02:00
Fix tests reflecting removed 'OR' queries and array operator
This commit is contained in:
parent
8a25f16012
commit
b553b4b61e
@ -93,7 +93,7 @@ class StatusFilterTest extends BaseTestCase
|
|||||||
);
|
);
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
1,
|
1,
|
||||||
$treeNode->right,
|
$treeNode->right[0],
|
||||||
'Assert the right treenode to contain the numeric status for "Down"'
|
'Assert the right treenode to contain the numeric status for "Down"'
|
||||||
);
|
);
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
|
@ -86,6 +86,7 @@ class UrlViewFilterTest extends BaseTestCase
|
|||||||
{
|
{
|
||||||
public function testUrlParamCreation()
|
public function testUrlParamCreation()
|
||||||
{
|
{
|
||||||
|
$this->markTestSkipped('Or queries are disabled');
|
||||||
$searchEngine = new Filter();
|
$searchEngine = new Filter();
|
||||||
$searchEngine->createFilterDomain('host')
|
$searchEngine->createFilterDomain('host')
|
||||||
->registerAttribute(
|
->registerAttribute(
|
||||||
@ -140,7 +141,7 @@ class UrlViewFilterTest extends BaseTestCase
|
|||||||
'Assert the field to be set correctly'
|
'Assert the field to be set correctly'
|
||||||
);
|
);
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
$tree->root->right,
|
$tree->root->right[0],
|
||||||
'Hans Wurst',
|
'Hans Wurst',
|
||||||
'Assert the value to be set correctly'
|
'Assert the value to be set correctly'
|
||||||
);
|
);
|
||||||
@ -148,6 +149,8 @@ class UrlViewFilterTest extends BaseTestCase
|
|||||||
|
|
||||||
public function testConjunctionFilterInUrl()
|
public function testConjunctionFilterInUrl()
|
||||||
{
|
{
|
||||||
|
$this->markTestSkipped("OR queries are disabled");
|
||||||
|
|
||||||
$filterFactory = new UrlViewFilter(new FilterMock());
|
$filterFactory = new UrlViewFilter(new FilterMock());
|
||||||
$query = 'attr1!=Hans+Wurst&test=test123|bla=1';
|
$query = 'attr1!=Hans+Wurst&test=test123|bla=1';
|
||||||
$tree = $filterFactory->parseUrl($query);
|
$tree = $filterFactory->parseUrl($query);
|
||||||
@ -157,6 +160,7 @@ class UrlViewFilterTest extends BaseTestCase
|
|||||||
|
|
||||||
public function testImplicitConjunctionInUrl()
|
public function testImplicitConjunctionInUrl()
|
||||||
{
|
{
|
||||||
|
$this->markTestSkipped("OR queries are disabled");
|
||||||
$filterFactory = new UrlViewFilter(new FilterMock());
|
$filterFactory = new UrlViewFilter(new FilterMock());
|
||||||
$query = 'attr1!=Hans+Wurst&test=test123|bla=1|2|3';
|
$query = 'attr1!=Hans+Wurst&test=test123|bla=1|2|3';
|
||||||
$tree = $filterFactory->parseUrl($query);
|
$tree = $filterFactory->parseUrl($query);
|
||||||
|
@ -135,6 +135,7 @@ class FilterTest extends BaseTestCase
|
|||||||
|
|
||||||
public function testSingleOrQueryTreeCreation()
|
public function testSingleOrQueryTreeCreation()
|
||||||
{
|
{
|
||||||
|
$this->markTestSkipped('OR queries are disabled for now');
|
||||||
$searchEngine = new Filter();
|
$searchEngine = new Filter();
|
||||||
$searchEngine->createFilterDomain('host')
|
$searchEngine->createFilterDomain('host')
|
||||||
->registerAttribute(
|
->registerAttribute(
|
||||||
@ -171,6 +172,7 @@ class FilterTest extends BaseTestCase
|
|||||||
|
|
||||||
public function testMultipleOrQueries()
|
public function testMultipleOrQueries()
|
||||||
{
|
{
|
||||||
|
$this->markTestSkipped('OR queries are disabled');
|
||||||
$searchEngine = new Filter();
|
$searchEngine = new Filter();
|
||||||
$searchEngine->createFilterDomain('host')
|
$searchEngine->createFilterDomain('host')
|
||||||
->registerAttribute(
|
->registerAttribute(
|
||||||
@ -222,6 +224,7 @@ class FilterTest extends BaseTestCase
|
|||||||
|
|
||||||
public function testComplexQueryTreeCreation()
|
public function testComplexQueryTreeCreation()
|
||||||
{
|
{
|
||||||
|
$this->markTestSkipped('OR queries are disabled for now');
|
||||||
$searchEngine = new Filter();
|
$searchEngine = new Filter();
|
||||||
$searchEngine->createFilterDomain('host')
|
$searchEngine->createFilterDomain('host')
|
||||||
->registerAttribute(
|
->registerAttribute(
|
||||||
|
@ -121,13 +121,13 @@ class BooleanFilterTest extends BaseTestCase
|
|||||||
$node = $filter->createTreeNode('is with problem', 'host_status');
|
$node = $filter->createTreeNode('is with problem', 'host_status');
|
||||||
$this->assertEquals('host_problem', $node->left, 'Assert the left part of the node to be host_problem');
|
$this->assertEquals('host_problem', $node->left, 'Assert the left part of the node to be host_problem');
|
||||||
$this->assertEquals(Node::OPERATOR_EQUALS, $node->operator, 'Assert the operator to be equals');
|
$this->assertEquals(Node::OPERATOR_EQUALS, $node->operator, 'Assert the operator to be equals');
|
||||||
$this->assertEquals(1, $node->right, 'Assert the value to be 1');
|
$this->assertEquals(1, $node->right[0], 'Assert the value to be 1');
|
||||||
|
|
||||||
|
|
||||||
$node = $filter->createTreeNode('is not with problem', 'host_status');
|
$node = $filter->createTreeNode('is not with problem', 'host_status');
|
||||||
$this->assertEquals('host_problem', $node->left, 'Assert the left part of the node to be host_problem');
|
$this->assertEquals('host_problem', $node->left, 'Assert the left part of the node to be host_problem');
|
||||||
$this->assertEquals(Node::OPERATOR_EQUALS, $node->operator, 'Assert the operator to be equals');
|
$this->assertEquals(Node::OPERATOR_EQUALS, $node->operator, 'Assert the operator to be equals');
|
||||||
$this->assertEquals(0, $node->right, 'Assert the value to be 0 for not equals');
|
$this->assertEquals(0, $node->right[0], 'Assert the value to be 0 for not equals');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testTimeQueryNodeCreation()
|
public function testTimeQueryNodeCreation()
|
||||||
@ -143,11 +143,11 @@ class BooleanFilterTest extends BaseTestCase
|
|||||||
|
|
||||||
$this->assertEquals('time_node', $node->left->left, 'Assert the left part of the node to be time filter');
|
$this->assertEquals('time_node', $node->left->left, 'Assert the left part of the node to be time filter');
|
||||||
$this->assertEquals(Node::OPERATOR_GREATER_EQ, $node->left->operator, 'Assert the operator to be greater eq');
|
$this->assertEquals(Node::OPERATOR_GREATER_EQ, $node->left->operator, 'Assert the operator to be greater eq');
|
||||||
$this->assertEquals('-1 hour', $node->left->right, 'Assert the value to be the strotime info');
|
$this->assertEquals('-1 hour', $node->left->right[0], 'Assert the value to be the strotime info');
|
||||||
|
|
||||||
$this->assertEquals('host_problem', $node->right->left, 'Assert the right part of the node to be host_problem');
|
$this->assertEquals('host_problem', $node->right->left, 'Assert the right part of the node to be host_problem');
|
||||||
$this->assertEquals(Node::OPERATOR_EQUALS, $node->right->operator, 'Assert the operator to be equals');
|
$this->assertEquals(Node::OPERATOR_EQUALS, $node->right->operator, 'Assert the operator to be equals');
|
||||||
$this->assertEquals(1, $node->right->right, 'Assert the value to be 1');
|
$this->assertEquals(1, $node->right->right[0], 'Assert the value to be 1');
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user