mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2026-04-15 05:56:12 -04:00
Add SPDX license headers and mark source files as GPL-3.0-or-later to preserve the option to relicense under later GPL versions.
35 lines
1,015 B
PHP
35 lines
1,015 B
PHP
<?php
|
|
|
|
// SPDX-FileCopyrightText: 2018 Icinga GmbH <https://icinga.com>
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
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'))
|
|
);
|
|
}
|
|
}
|