|
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 $purgedResponseWasShown = 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 presentApplicationWasPurged(): void { |
|
40
|
|
|
$this->purgedResponseWasShown = true; |
|
41
|
|
|
} |
|
42
|
|
|
|
|
43
|
|
|
public function purgedResponseWasShown(): bool { |
|
44
|
|
|
return $this->purgedResponseWasShown; |
|
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
|
|
|
} |