Completed
Push — master ( 88699b...ae29c5 )
by Gabriel
13s
created

getShownApplication()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
declare( strict_types = 1 );
4
5
namespace WMDE\Fundraising\Frontend\MembershipContext\Tests\Integration\UseCases\ShowApplicationConfirmation;
6
7
use WMDE\Fundraising\Frontend\MembershipContext\Domain\Model\Application;
8
use WMDE\Fundraising\Frontend\MembershipContext\UseCases\ShowApplicationConfirmation\ShowApplicationConfirmationPresenter;
9
10
/**
11
 * @license GNU GPL v2+
12
 * @author Jeroen De Dauw < [email protected] >
13
 */
14
class FakeShowApplicationConfirmationPresenter implements ShowApplicationConfirmationPresenter {
15
16
	private $application;
17
	private $updateToken;
18
	private $anonymizedResponseWasShown = false;
19
	private $accessViolationWasShown = false;
20
	private $shownTechnicalError;
21
22
	public function presentConfirmation( Application $application, string $updateToken ): void {
23
		if ( $this->application !== null ) {
24
			throw new \RuntimeException( 'Presenter should only be invoked once' );
25
		}
26
27
		$this->application = $application;
28
		$this->updateToken = $updateToken;
29
	}
30
31
	public function getShownApplication(): Application {
32
		return $this->application;
33
	}
34
35
	public function getShownUpdateToken(): string {
36
		return $this->updateToken;
37
	}
38
39
	public function presentApplicationWasAnonymized(): void {
40
		$this->anonymizedResponseWasShown = true;
41
	}
42
43
	public function anonymizedResponseWasShown(): bool {
44
		return $this->anonymizedResponseWasShown;
45
	}
46
47
	public function presentAccessViolation(): void {
48
		$this->accessViolationWasShown = true;
49
	}
50
51
	public function accessViolationWasShown(): bool {
52
		return $this->accessViolationWasShown;
53
	}
54
55
	public function presentTechnicalError( string $error ): void {
56
		$this->shownTechnicalError = $error;
57
	}
58
59
	public function getShownTechnicalError(): string {
60
		return $this->shownTechnicalError;
61
	}
62
63
}