1 | <?php |
||
23 | class GlobalSetsTest extends Unit |
||
24 | { |
||
25 | /** |
||
26 | * @var GlobalSets |
||
27 | */ |
||
28 | private $converter; |
||
29 | |||
30 | /** |
||
31 | * Set the converter. |
||
32 | * |
||
33 | * @SuppressWarnings(PHPMD.CamelCaseMethodName) |
||
34 | */ |
||
35 | protected function _before() |
||
39 | |||
40 | //============================================================================================================== |
||
41 | //================================================= TESTS ==================================================== |
||
42 | //============================================================================================================== |
||
43 | |||
44 | /** |
||
45 | * @dataProvider provideGlobalSets |
||
46 | * |
||
47 | * @param GlobalSetElement $set |
||
48 | * @param array $definition |
||
49 | */ |
||
50 | public function testGetRecordDefinition(GlobalSetElement $set, array $definition) |
||
56 | |||
57 | /** |
||
58 | * @dataProvider provideGlobalSets |
||
59 | * |
||
60 | * @param GlobalSetElement $set |
||
61 | * @param array $definition |
||
62 | * @param bool $valid |
||
63 | */ |
||
64 | public function testSaveRecord(GlobalSetElement $set, array $definition, bool $valid) |
||
82 | |||
83 | /** |
||
84 | * @dataProvider provideGlobalSets |
||
85 | * |
||
86 | * @param GlobalSetElement $set |
||
87 | */ |
||
88 | public function testDeleteRecord(GlobalSetElement $set) |
||
96 | |||
97 | //============================================================================================================== |
||
98 | //============================================== PROVIDERS =================================================== |
||
99 | //============================================================================================================== |
||
100 | |||
101 | /** |
||
102 | * @return array |
||
103 | */ |
||
104 | public function provideGlobalSets() |
||
122 | |||
123 | //============================================================================================================== |
||
124 | //================================================ HELPERS =================================================== |
||
125 | //============================================================================================================== |
||
126 | |||
127 | /** |
||
128 | * @param GlobalSet $mockGlobalSet |
||
129 | * |
||
130 | * @return array |
||
131 | */ |
||
132 | private function getMockGlobalSetDefinition(GlobalSetElement $mockGlobalSet) |
||
157 | |||
158 | /** |
||
159 | * @param int $setId |
||
160 | * @param string $siteHandle |
||
161 | * |
||
162 | * @return Mock|GlobalSet |
||
163 | */ |
||
164 | private function getMockGlobalSet(int $setId, string $siteHandle = 'default') |
||
215 | |||
216 | /** |
||
217 | * Get a mock site. |
||
218 | * |
||
219 | * @param string $handle |
||
220 | * |
||
221 | * @return Mock|Site |
||
222 | */ |
||
223 | private function getMockSite(string $handle = 'default') |
||
232 | } |
||
233 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..