Passed
Push — master ( 7d7cf1...424d8c )
by Gabriel
37s queued 10s
created

ActiveBannerSelectionDataTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 15
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A test_given_active_campaign_for_visitor_then_correct_values_are_stored_and_returned() 0 10 1
1
<?php
2
3
declare( strict_types = 1 );
4
5
namespace WMDE\BannerServer\Tests\Unit\UseCase\BannerSelection;
6
7
use WMDE\BannerServer\Tests\Fixtures\VisitorFixture;
8
use WMDE\BannerServer\UseCase\BannerSelection\ActiveBannerSelectionData;
9
10
/**
11
 * @covers \WMDE\BannerServer\UseCase\BannerSelection\ActiveBannerSelectionData
12
 * Class ActiveBannerSelectionDataTest
13
 */
14
class ActiveBannerSelectionDataTest extends \PHPUnit\Framework\TestCase {
15
16
	const BANNER_TEST_IDENTIFIER = 'testIdentifier';
17
	const TEST_DATETIME = '19-06-1992 01:02:03';
18
19
	public function test_given_active_campaign_for_visitor_then_correct_values_are_stored_and_returned() {
20
		$bannerSelectionData = new ActiveBannerSelectionData(
21
			VisitorFixture::getTestVisitor(),
22
			self::BANNER_TEST_IDENTIFIER,
23
			new \DateTime( self::TEST_DATETIME )
24
		);
25
		$this->assertTrue( $bannerSelectionData->displayBanner() );
26
		$this->assertEquals( new \DateTime( self::TEST_DATETIME ), $bannerSelectionData->getCampaignEnd() );
27
		$this->assertEquals( self::BANNER_TEST_IDENTIFIER, $bannerSelectionData->getBannerIdentifier() );
28
		$this->assertEquals( VisitorFixture::getTestVisitor(), $bannerSelectionData->getVisitorData() );
29
	}
30
}
31