summaryrefslogtreecommitdiffstats
path: root/test/php/library/Businessprocess/MetadataTest.php
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 12:42:35 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 12:42:35 +0000
commit18db984057b83ca4962c89b6b79bdce6a660b58f (patch)
tree2c9f23c086b4dfcb3e7eb2ec69210206b0782d3c /test/php/library/Businessprocess/MetadataTest.php
parentInitial commit. (diff)
downloadicingaweb2-module-businessprocess-upstream.tar.xz
icingaweb2-module-businessprocess-upstream.zip
Adding upstream version 2.4.0.upstream/2.4.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--test/php/library/Businessprocess/MetadataTest.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/php/library/Businessprocess/MetadataTest.php b/test/php/library/Businessprocess/MetadataTest.php
new file mode 100644
index 0000000..765caf8
--- /dev/null
+++ b/test/php/library/Businessprocess/MetadataTest.php
@@ -0,0 +1,32 @@
+<?php
+
+namespace Tests\Icinga\Module\Businessprocess;
+
+use Icinga\Module\Businessprocess\Metadata;
+use Icinga\Module\Businessprocess\Test\BaseTestCase;
+
+class MetadataTest extends BaseTestCase
+{
+ public function testDetectsMatchingPrefixes()
+ {
+ $meta = new Metadata('matchme');
+ $this->assertFalse(
+ $meta->nameIsPrefixedWithOneOf(array())
+ );
+ $this->assertFalse(
+ $meta->nameIsPrefixedWithOneOf(array('matchr', 'atchme'))
+ );
+ $this->assertTrue(
+ $meta->nameIsPrefixedWithOneOf(array('not', 'mat', 'yes'))
+ );
+ $this->assertTrue(
+ $meta->nameIsPrefixedWithOneOf(array('m'))
+ );
+ $this->assertTrue(
+ $meta->nameIsPrefixedWithOneOf(array('matchme'))
+ );
+ $this->assertFalse(
+ $meta->nameIsPrefixedWithOneOf(array('matchmenot'))
+ );
+ }
+}