mirror of
https://github.com/Icinga/icingaweb2.git
synced 2026-04-05 09:15:35 -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.
39 lines
1.1 KiB
PHP
39 lines
1.1 KiB
PHP
<?php
|
|
|
|
// SPDX-FileCopyrightText: 2018 Icinga GmbH <https://icinga.com>
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
namespace Tests\Icinga\Regression;
|
|
|
|
use ReflectionClass;
|
|
use Icinga\Application\Icinga;
|
|
use Icinga\Application\Modules\Module;
|
|
use Icinga\Test\BaseTestCase;
|
|
|
|
/**
|
|
* Regression-Test for bug #11831
|
|
*
|
|
* Empty lines in module.info must be ignored if they're not part of the module's description
|
|
*
|
|
* @see https://dev.icinga.com/issues/11831
|
|
*/
|
|
class Bug11831Test extends BaseTestCase
|
|
{
|
|
public function testNewlinesInModuleInfo()
|
|
{
|
|
$moduleInfo = <<<'EOT'
|
|
|
|
version: 1.0.0
|
|
|
|
EOT;
|
|
$moduleInfoFile = tmpfile();
|
|
fwrite($moduleInfoFile, $moduleInfo);
|
|
$module = new Module(Icinga::app(), 'Bug11831', '/dev/null');
|
|
$reflection = new ReflectionClass($module);
|
|
$prop = $reflection->getProperty('metadataFile');
|
|
$meta = stream_get_meta_data($moduleInfoFile);
|
|
$prop->setValue($module, $meta['uri']);
|
|
$this->assertEquals($module->getVersion(), '1.0.0');
|
|
fclose($moduleInfoFile);
|
|
}
|
|
}
|