From 8db123ffa038fe0eec4645ae2cd439c7f5b8e747 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 15 Oct 2015 17:22:47 +0200 Subject: [PATCH] MacroTest: Remove obsolete tests The macro resolver does not know anymore about customvars, just plain object attributes, which are now covered by testFaultyMacros() --- .../library/Monitoring/Object/MacroTest.php | 32 ++----------------- 1 file changed, 3 insertions(+), 29 deletions(-) diff --git a/modules/monitoring/test/php/library/Monitoring/Object/MacroTest.php b/modules/monitoring/test/php/library/Monitoring/Object/MacroTest.php index de90e1e81..6b2c30a53 100644 --- a/modules/monitoring/test/php/library/Monitoring/Object/MacroTest.php +++ b/modules/monitoring/test/php/library/Monitoring/Object/MacroTest.php @@ -44,41 +44,15 @@ class MacroTest extends BaseTestCase $this->assertEquals(Macro::resolveMacros('$service.description$', $svcMock), $svcMock->service_description); } - public function testCustomvars() - { - $objectMock = Mockery::mock('object'); - $objectMock->customvars = array( - 'customvar' => 'test' - ); - - $this->assertEquals(Macro::resolveMacros('$CUSTOMVAR$', $objectMock), $objectMock->customvars['customvar']); - } - public function testFaultyMacros() { $hostMock = Mockery::mock('host'); $hostMock->host_name = 'test'; - $hostMock->customvars = array( - 'host' => 'te', - 'name' => 'st' - ); + $hostMock->host = 'te'; $this->assertEquals( - Macro::resolveMacros('$$HOSTNAME$ $ HOSTNAME$ $HOST$NAME$', $hostMock), - '$test $ HOSTNAME$ teNAME$' - ); - } - - public function testMacrosWithSpecialCharacters() - { - $objectMock = Mockery::mock('object'); - $objectMock->customvars = array( - 'v€ry_sp3c|@l' => 'not too special!' - ); - - $this->assertEquals( - Macro::resolveMacros('$V€RY_SP3C|@L$', $objectMock), - $objectMock->customvars['v€ry_sp3c|@l'] + '$test $ HOSTNAME$ teNAME$', + Macro::resolveMacros('$$HOSTNAME$ $ HOSTNAME$ $host$NAME$', $hostMock) ); } }