mirror of
https://github.com/Icinga/icingaweb2.git
synced 2026-07-10 02:01:15 -04:00
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.
30 lines
854 B
PHP
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'
|
|
);
|
|
}
|
|
}
|