-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFormattingTest.php
60 lines (45 loc) · 1.29 KB
/
FormattingTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
declare(strict_types=1);
namespace Qubus\Tests\Routing;
use PHPUnit\Framework\Assert;
use PHPUnit\Framework\TestCase;
use Qubus\Routing\Formatting;
class FormattingTest extends TestCase
{
/** @test */
public function canRemoveTrailingSlash()
{
$string = 'string/';
Assert::assertSame('string', Formatting::removeTrailingSlash($string));
}
/** @test */
public function canAddTrailingSlash()
{
$string = 'string';
Assert::assertSame('string/', Formatting::addTrailingSlash($string));
}
/** @test */
public function addTrailingSlashDoesNotProduceDuplicates()
{
$string = 'string/';
Assert::assertSame('string/', Formatting::addTrailingSlash($string));
}
/** @test */
public function canRemoveLeadingSlash()
{
$string = '/string';
Assert::assertSame('string', Formatting::removeLeadingSlash($string));
}
/** @test */
public function canAddLeadingSlash()
{
$string = 'string';
Assert::assertSame('/string', Formatting::addLeadingSlash($string));
}
/** @test */
public function addLeadingSlashDoesNotProduceDuplicates()
{
$string = '/string';
Assert::assertSame('/string', Formatting::addLeadingSlash($string));
}
}