Completed
Push — master ( 00092a...39103d )
by wiese
86:17 queued 21:06
created

testGivenPrefixesWithPath_prefixIsPrependedToFilename()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
declare( strict_types = 1 );
4
5
namespace WMDE\Fundraising\Frontend\Tests\Unit\Presentation;
6
7
use WMDE\Fundraising\Frontend\Presentation\FilePrefixer;
8
9
class FilePrefixerTest extends \PHPUnit\Framework\TestCase {
10
11
	public function testGivenNoFilePrefixes_fileNameIsNotChanged(): void {
12
		$prefixer = new FilePrefixer( '' );
13
		$this->assertSame( 'wmde.js', $prefixer->prefixFile( 'wmde.js' ) );
14
	}
15
16
	public function testGivenPrefixes_prefixIsPrependedToFilename(): void {
17
		$prefixer = new FilePrefixer( 'badcaffee' );
18
		$this->assertSame( 'badcaffee.wmde.js', $prefixer->prefixFile( 'wmde.js' ) );
19
	}
20
21
	public function testGivenPrefixesWithPath_prefixIsPrependedToFilename(): void {
22
		$prefixer = new FilePrefixer( 'badcaffee' );
23
		$this->assertSame( 'res/js/badcaffee.wmde.js', $prefixer->prefixFile( 'res/js/wmde.js' ) );
24
	}
25
26
}
27