|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace BVCR\Behat\Resolver; |
|
4
|
|
|
|
|
5
|
|
|
use BVCR\Behat\Cassette\FileNamingStrategy; |
|
6
|
|
|
|
|
7
|
|
|
class Configuration |
|
8
|
|
|
{ |
|
9
|
|
|
/** @var string */ |
|
10
|
|
|
private $cassettePath; |
|
11
|
|
|
/** @var string */ |
|
12
|
|
|
private $cassetteStorage; |
|
13
|
|
|
/** @var array */ |
|
14
|
|
|
private $libraryHooks; |
|
15
|
|
|
/** @var array */ |
|
16
|
|
|
private $requestMatchers; |
|
17
|
|
|
/** @var string */ |
|
18
|
|
|
private $mode; |
|
19
|
|
|
/** @var array */ |
|
20
|
|
|
private $tags; |
|
21
|
|
|
/** @var \BVCR\Behat\Cassette\FileNamingStrategy */ |
|
22
|
|
|
private $fileNamingStrategy; |
|
23
|
|
|
|
|
24
|
1 |
|
public function __construct($cassettePath, $cassetteStorage, array $tags, $fileNamingStrategy) |
|
25
|
|
|
{ |
|
26
|
1 |
|
$this->setCassettePath($cassettePath); |
|
27
|
1 |
|
$this->setCassetteStorage($cassetteStorage); |
|
28
|
1 |
|
$this->setTags($tags); |
|
29
|
1 |
|
$this->setFileNamingStrategy($fileNamingStrategy); |
|
30
|
1 |
|
} |
|
31
|
|
|
/** |
|
32
|
|
|
* @return string |
|
33
|
|
|
*/ |
|
34
|
1 |
|
public function getCassettePath() |
|
35
|
|
|
{ |
|
36
|
1 |
|
return $this->cassettePath; |
|
37
|
|
|
} |
|
38
|
|
|
|
|
39
|
|
|
/** |
|
40
|
|
|
* @param string $cassettePath |
|
41
|
|
|
*/ |
|
42
|
1 |
|
public function setCassettePath($cassettePath) |
|
43
|
|
|
{ |
|
44
|
1 |
|
$this->cassettePath = $cassettePath; |
|
45
|
1 |
|
} |
|
46
|
|
|
|
|
47
|
|
|
/** |
|
48
|
|
|
* @return string |
|
49
|
|
|
*/ |
|
50
|
1 |
|
public function getCassetteStorage() |
|
51
|
|
|
{ |
|
52
|
1 |
|
return $this->cassetteStorage; |
|
53
|
|
|
} |
|
54
|
|
|
|
|
55
|
|
|
/** |
|
56
|
|
|
* @param string $cassetteStorage |
|
57
|
|
|
*/ |
|
58
|
1 |
|
public function setCassetteStorage($cassetteStorage) |
|
59
|
|
|
{ |
|
60
|
1 |
|
$this->cassetteStorage = $cassetteStorage; |
|
61
|
1 |
|
} |
|
62
|
|
|
|
|
63
|
|
|
/** |
|
64
|
|
|
* @return array |
|
65
|
|
|
*/ |
|
66
|
1 |
|
public function getLibraryHooks() |
|
67
|
|
|
{ |
|
68
|
1 |
|
return $this->libraryHooks; |
|
69
|
|
|
} |
|
70
|
|
|
|
|
71
|
|
|
/** |
|
72
|
|
|
* @param array $libraryHooks |
|
73
|
|
|
*/ |
|
74
|
1 |
|
public function setLibraryHooks(array $libraryHooks) |
|
75
|
|
|
{ |
|
76
|
1 |
|
$this->libraryHooks = $libraryHooks; |
|
77
|
1 |
|
} |
|
78
|
|
|
|
|
79
|
|
|
/** |
|
80
|
|
|
* @return array |
|
81
|
|
|
*/ |
|
82
|
1 |
|
public function getRequestMatchers() |
|
83
|
|
|
{ |
|
84
|
1 |
|
return $this->requestMatchers; |
|
85
|
|
|
} |
|
86
|
|
|
|
|
87
|
|
|
/** |
|
88
|
|
|
* @param array $requestMatchers |
|
89
|
|
|
*/ |
|
90
|
1 |
|
public function setRequestMatchers(array $requestMatchers) |
|
91
|
|
|
{ |
|
92
|
1 |
|
$this->requestMatchers = $requestMatchers; |
|
93
|
1 |
|
} |
|
94
|
|
|
|
|
95
|
|
|
/** |
|
96
|
|
|
* @return string |
|
97
|
|
|
*/ |
|
98
|
|
|
public function getMode() |
|
99
|
|
|
{ |
|
100
|
|
|
return $this->mode; |
|
101
|
|
|
} |
|
102
|
|
|
|
|
103
|
|
|
/** |
|
104
|
|
|
* @param string $mode |
|
105
|
|
|
*/ |
|
106
|
1 |
|
public function setMode($mode) |
|
107
|
|
|
{ |
|
108
|
1 |
|
$this->mode = $mode; |
|
109
|
1 |
|
} |
|
110
|
|
|
|
|
111
|
|
|
/** |
|
112
|
|
|
* @return array |
|
113
|
|
|
*/ |
|
114
|
1 |
|
public function getTags() |
|
115
|
|
|
{ |
|
116
|
1 |
|
return $this->tags; |
|
117
|
|
|
} |
|
118
|
|
|
|
|
119
|
|
|
/** |
|
120
|
|
|
* @param array $tags |
|
121
|
|
|
*/ |
|
122
|
1 |
|
public function setTags(array $tags) |
|
123
|
|
|
{ |
|
124
|
1 |
|
$this->tags = $tags; |
|
125
|
1 |
|
} |
|
126
|
|
|
|
|
127
|
|
|
/** |
|
128
|
|
|
* @param FileNamingStrategy $fileNamingStrategy |
|
129
|
|
|
*/ |
|
130
|
1 |
|
public function setFileNamingStrategy(FileNamingStrategy $fileNamingStrategy) |
|
131
|
|
|
{ |
|
132
|
1 |
|
$this->fileNamingStrategy = $fileNamingStrategy; |
|
133
|
1 |
|
} |
|
134
|
|
|
|
|
135
|
|
|
/** |
|
136
|
|
|
* @return \BVCR\Behat\Cassette\FileNamingStrategy |
|
137
|
|
|
*/ |
|
138
|
|
|
public function getFileNamingStrategy() |
|
139
|
|
|
{ |
|
140
|
|
|
return $this->fileNamingStrategy; |
|
141
|
|
|
} |
|
142
|
|
|
} |
|
143
|
|
|
|