SofortPaymentTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 16
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testInitialProperties() 0 4 1
A testAccessors() 0 8 1
1
<?php
2
3
declare( strict_types = 1 );
4
5
namespace WMDE\Fundraising\Store\Tests\Unit\DonationPayments;
6
7
use DateTime;
8
use PHPUnit\Framework\TestCase;
9
use WMDE\Fundraising\Entities\DonationPayments\SofortPayment;
10
11
/**
12
 * @covers \WMDE\Fundraising\Entities\DonationPayments\SofortPayment
13
 */
14
class SofortPaymentTest extends TestCase {
15
16
	public function testInitialProperties(): void {
17
		$payment = new SofortPayment();
18
		$this->assertNull( $payment->getConfirmedAt() );
19
	}
20
21
	public function testAccessors(): void {
22
		$payment = new SofortPayment();
23
		$payment->setId( 5 );
24
		$payment->setConfirmedAt( new DateTime( '2008-11-03T15:30:00Z' ) );
25
26
		$this->assertSame( 5, $payment->getId() );
27
		$this->assertEquals( new DateTime( '2008-11-03T15:30:00Z' ), $payment->getConfirmedAt() );
28
	}
29
}
30