Completed
Pull Request — master (#16)
by Tonina
84:23 queued 19:43
created

BucketTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A test_given_first_time_visitor_main_banner_is_returned() 0 7 1
A test_given_not_first_time_visitor_other_banner_is_returned() 0 7 1
1
<?php
0 ignored issues
show
introduced by
Missing declare(strict_types = 1).
Loading history...
2
3
namespace WMDE\BannerServer\Tests\Unit\Entity\BannerSelection;
4
5
use WMDE\BannerServer\Entity\BannerSelection\Banner;
6
use WMDE\BannerServer\Entity\BannerSelection\Bucket;
7
8
class BucketTest extends \PHPUnit\Framework\TestCase {
9
10
	public function test_given_first_time_visitor_main_banner_is_returned() {
11
		$bucket = new Bucket(
12
			'C18_WMDE_Test_ctrl',
13
			new Banner( 'C18_WMDE_Test_ctrl_main' ),
14
			new Banner( 'C18_WMDE_Test_ctrl_secondary' )
15
		);
16
		$this->assertEquals( $bucket->getBanner( 0 ), 'C18_WMDE_Test_ctrl_main');
0 ignored issues
show
Coding Style introduced by
Expected 1 spaces before closing bracket; 0 found
Loading history...
17
	}
18
19
	public function test_given_not_first_time_visitor_other_banner_is_returned() {
20
		$bucket = new Bucket(
21
			'C18_WMDE_Test_ctrl',
22
			new Banner( 'C18_WMDE_Test_ctrl_main' ),
23
			new Banner( 'C18_WMDE_Test_ctrl_secondary' )
24
		);
25
		$this->assertEquals( $bucket->getBanner( 1 ), 'C18_WMDE_Test_ctrl_secondary');
0 ignored issues
show
Coding Style introduced by
Expected 1 spaces before closing bracket; 0 found
Loading history...
26
	}
27
}
28