mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2025-12-23 16:19:42 -05:00
33 lines
904 B
PHP
33 lines
904 B
PHP
|
|
<?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'))
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|