Completed
Branch master (2b18f3)
by Wanderson
02:17
created

UrlTest::testFormat()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 8
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 10
rs 9.4285
1
<?php
2
3
namespace Win\Helper;
4
5
use Win\Helper\Url;
6
7
class UrlTest extends \PHPUnit_Framework_TestCase {
8
9
	public function testFormat() {
10
		Url::instance()->setSufix('/');
11
		$link = 'my-custom-link';
12
		$formatedLink = Url::instance()->format($link);
13
		$this->assertEquals($formatedLink, 'my-custom-link/');
14
15
		$linkBar = 'my-custom-link/';
16
		$formatedLinkBar = Url::instance()->format($linkBar);
17
		$this->assertEquals($formatedLinkBar, 'my-custom-link/');
18
	}
19
20
	public function testFormatExtension() {
21
		Url::instance()->setSufix('.html');
22
		$link2 = 'my-custom-link-with-extension';
23
		$formatedLink2 = Url::instance()->format($link2);
24
		$this->assertEquals($formatedLink2, 'my-custom-link-with-extension.html');
25
	}
26
27
}
28