1 | <?php |
||
25 | class UpdatePage extends BaseUpdatePage implements UpdatePageInterface |
||
26 | { |
||
27 | use ChecksCodeImmutability; |
||
28 | |||
29 | /** |
||
30 | * {@inheritdoc} |
||
31 | */ |
||
32 | public function chooseParent(TaxonInterface $taxon) |
||
36 | |||
37 | /** |
||
38 | * {@inheritdoc} |
||
39 | */ |
||
40 | public function describeItAs($description, $languageCode) |
||
44 | |||
45 | /** |
||
46 | * {@inheritdoc} |
||
47 | */ |
||
48 | public function nameIt($name, $languageCode) |
||
55 | |||
56 | /** |
||
57 | * {@inheritdoc} |
||
58 | */ |
||
59 | public function specifySlug($slug, $languageCode) |
||
63 | |||
64 | /** |
||
65 | * {@inheritdoc} |
||
66 | */ |
||
67 | public function attachImage($path, $type = null) |
||
80 | |||
81 | /** |
||
82 | * {@inheritdoc} |
||
83 | */ |
||
84 | public function isImageWithTypeDisplayed($type) |
||
85 | { |
||
86 | $imageElement = $this->getImageElementByType($type); |
||
87 | |||
88 | if (null === $imageElement) { |
||
89 | return false; |
||
90 | } |
||
91 | |||
92 | $imageUrl = $imageElement->find('css', 'img')->getAttribute('src'); |
||
93 | $this->getDriver()->visit($imageUrl); |
||
94 | $pageText = $this->getDocument()->getText(); |
||
95 | $this->getDriver()->back(); |
||
96 | |||
97 | return false === stripos($pageText, '404 Not Found'); |
||
98 | } |
||
99 | |||
100 | /** |
||
101 | * {@inheritdoc} |
||
102 | */ |
||
103 | public function isSlugReadOnly($languageCode = 'en_US') |
||
107 | |||
108 | /** |
||
109 | * {@inheritdoc} |
||
110 | */ |
||
111 | public function removeImageWithType($type) |
||
112 | { |
||
113 | $imageElement = $this->getImageElementByType($type); |
||
114 | $imageElement->clickLink('Delete'); |
||
115 | } |
||
116 | |||
117 | public function removeFirstImage() |
||
122 | |||
123 | /** |
||
124 | * {@inheritdoc} |
||
125 | */ |
||
126 | public function enableSlugModification($languageCode = 'en_US') |
||
130 | |||
131 | /** |
||
132 | * {@inheritdoc} |
||
133 | */ |
||
134 | public function countImages() |
||
140 | |||
141 | /** |
||
142 | * {@inheritdoc} |
||
143 | */ |
||
144 | public function changeImageWithType($type, $path) |
||
151 | |||
152 | /** |
||
153 | * {@inheritdoc} |
||
154 | */ |
||
155 | public function modifyFirstImageType($type) |
||
162 | |||
163 | /** |
||
164 | * {@inheritdoc} |
||
165 | */ |
||
166 | public function getParent() |
||
170 | |||
171 | /** |
||
172 | * {@inheritdoc} |
||
173 | */ |
||
174 | public function getSlug($languageCode = 'en_US') |
||
178 | |||
179 | /** |
||
180 | * {@inheritdoc} |
||
181 | */ |
||
182 | public function getValidationMessageForImage() |
||
193 | |||
194 | /** |
||
195 | * {@inheritdoc} |
||
196 | */ |
||
197 | public function getValidationMessageForImageAtPlace($place) |
||
208 | |||
209 | /** |
||
210 | * {@inheritdoc} |
||
211 | */ |
||
212 | public function activateLanguageTab($locale) |
||
227 | |||
228 | /** |
||
229 | * {@inheritdoc} |
||
230 | */ |
||
231 | protected function getElement($name, array $parameters = []) |
||
239 | |||
240 | /** |
||
241 | * @return NodeElement |
||
242 | */ |
||
243 | protected function getCodeElement() |
||
247 | |||
248 | /** |
||
249 | * {@inheritdoc} |
||
250 | */ |
||
251 | protected function getDefinedElements() |
||
264 | |||
265 | /** |
||
266 | * @return NodeElement |
||
267 | */ |
||
268 | private function getLastImageElement() |
||
276 | |||
277 | /** |
||
278 | * @return NodeElement |
||
279 | */ |
||
280 | private function getFirstImageElement() |
||
288 | |||
289 | /** |
||
290 | * @return NodeElement[] |
||
291 | */ |
||
292 | private function getImageElements() |
||
298 | |||
299 | /** |
||
300 | * @param string $type |
||
301 | * |
||
302 | * @return NodeElement |
||
303 | */ |
||
304 | private function getImageElementByType($type) |
||
315 | |||
316 | /** |
||
317 | * @param string $languageCode |
||
318 | */ |
||
319 | private function waitForSlugGenerationIfNecessary($languageCode = 'en_US') |
||
335 | } |
||
336 |