icingaweb2/test/php/library/Icinga/Util/StringHelperTest.php
jrauh01 3b9d663bcf
Replace array() with [] (#5509)
Replace the outdated `array()` spelling with the more modern `[]`. This
is applied throughout the whole project, also including phpdocs, tests,
view scripts and core modules.
2026-07-01 14:19:02 +02:00

30 lines
854 B
PHP

<?php
// SPDX-FileCopyrightText: 2018 Icinga GmbH <https://icinga.com>
// SPDX-License-Identifier: GPL-3.0-or-later
namespace Tests\Icinga\Util;
use Icinga\Test\BaseTestCase;
use Icinga\Util\StringHelper;
class StringHelperTest extends BaseTestCase
{
public function testWhetherTrimSplitReturnsACorrectValue()
{
$this->assertEquals(
['one', 'two', 'three'],
StringHelper::trimSplit(' one ,two , three'),
'String::trimSplit does not properly split a string and/or trim its elements'
);
}
public function testWhetherTrimSplitSplitsByTheGivenDelimiter()
{
$this->assertEquals(
['one', 'two', 'three'],
StringHelper::trimSplit('one.two.three', '.'),
'String::trimSplit does not split a string by the given delimiter'
);
}
}