@@ -73,6 +73,6 @@ |
||
73 | 73 | $operation = "/$operation"; |
74 | 74 | } |
75 | 75 | |
76 | - return $this->entityType() . "/$id$operation"; |
|
76 | + return $this->entityType()."/$id$operation"; |
|
77 | 77 | } |
78 | 78 | } |
@@ -11,8 +11,8 @@ |
||
11 | 11 | // Helpers. |
12 | 12 | use Behat\Mink\Element\NodeElement; |
13 | 13 | // Utils. |
14 | -use Drupal\TqExtension\Utils\XPath; |
|
15 | 14 | use Drupal\TqExtension\Cores\DrupalKernelPlaceholder; |
15 | +use Drupal\TqExtension\Utils\XPath; |
|
16 | 16 | |
17 | 17 | class RawPageContext extends RawDrupalContext |
18 | 18 | { |
@@ -7,9 +7,9 @@ |
||
7 | 7 | // Scope definitions. |
8 | 8 | use Behat\Behat\Hook\Scope; |
9 | 9 | // Utils. |
10 | +use Drupal\TqExtension\Cores\DrupalKernelPlaceholder; |
|
10 | 11 | use Drupal\TqExtension\Utils\Database\Database; |
11 | 12 | use Drupal\TqExtension\Utils\LogicalAssertion; |
12 | -use Drupal\TqExtension\Cores\DrupalKernelPlaceholder; |
|
13 | 13 | |
14 | 14 | class TqContext extends RawTqContext |
15 | 15 | { |
@@ -91,6 +91,9 @@ discard block |
||
91 | 91 | self::requireContext(__FUNCTION__, func_get_args()); |
92 | 92 | } |
93 | 93 | |
94 | + /** |
|
95 | + * @param string $path |
|
96 | + */ |
|
94 | 97 | public static function setCurrentPath($path) |
95 | 98 | { |
96 | 99 | self::requireContext(__FUNCTION__, func_get_args()); |
@@ -237,6 +240,8 @@ discard block |
||
237 | 240 | |
238 | 241 | /** |
239 | 242 | * {@inheritdoc} |
243 | + * @param string $type |
|
244 | + * @param string $name |
|
240 | 245 | */ |
241 | 246 | public static function drupalGetFilename($type, $name, $filename = null) |
242 | 247 | { |
@@ -245,6 +250,7 @@ discard block |
||
245 | 250 | |
246 | 251 | /** |
247 | 252 | * {@inheritdoc} |
253 | + * @param string $path |
|
248 | 254 | */ |
249 | 255 | public static function fileUnmanagedDelete($path) |
250 | 256 | { |
@@ -253,6 +259,8 @@ discard block |
||
253 | 259 | |
254 | 260 | /** |
255 | 261 | * {@inheritdoc} |
262 | + * @param string $source |
|
263 | + * @param string $destination |
|
256 | 264 | */ |
257 | 265 | public static function fileUnmanagedCopy($source, $destination = null, $replace = FILE_EXISTS_RENAME) |
258 | 266 | { |
@@ -165,7 +165,7 @@ |
||
165 | 165 | static $original = 'php_mail'; |
166 | 166 | |
167 | 167 | $systemMail = \Drupal::configFactory() |
168 | - ->getEditable('system.mail'); |
|
168 | + ->getEditable('system.mail'); |
|
169 | 169 | |
170 | 170 | if ($useTesting) { |
171 | 171 | // Store original mail system to restore it after scenario. |
@@ -4,14 +4,14 @@ |
||
4 | 4 | */ |
5 | 5 | |
6 | 6 | use Behat\Behat\Hook\Scope\BeforeFeatureScope; |
7 | -use Drupal\Core\Field\FieldDefinitionInterface; |
|
8 | -use Drupal\Core\Entity\FieldableEntityInterface; |
|
9 | -use Drupal\Core\Session\AccountInterface; |
|
7 | +use Drupal\Component\Render\FormattableMarkup; |
|
8 | +use Drupal\Component\Serialization\Json; |
|
10 | 9 | use Drupal\Core\Database\Database; |
11 | 10 | use Drupal\Core\Database\Query\Select; |
11 | +use Drupal\Core\Entity\FieldableEntityInterface; |
|
12 | +use Drupal\Core\Field\FieldDefinitionInterface; |
|
13 | +use Drupal\Core\Session\AccountInterface; |
|
12 | 14 | use Drupal\Core\StringTranslation\TranslatableMarkup; |
13 | -use Drupal\Component\Render\FormattableMarkup; |
|
14 | -use Drupal\Component\Serialization\Json; |
|
15 | 15 | use Drupal\TqExtension\Utils\Database\FetchField; |
16 | 16 | |
17 | 17 | // @codingStandardsIgnoreStart |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | $entity = entity_create($entityType, $values); |
164 | 164 | |
165 | 165 | entity_save($entityType, $entity); |
166 | - list($entityId, , $bundle) = entity_extract_ids($entityType, $entity); |
|
166 | + list($entityId,, $bundle) = entity_extract_ids($entityType, $entity); |
|
167 | 167 | |
168 | 168 | return [$entityId, $entityType, $bundle]; |
169 | 169 | } |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | { |
268 | 268 | $file .= '.js'; |
269 | 269 | $modulePath = static::drupalGetFilename('module', 'system'); |
270 | - $destination = dirname($modulePath) . '/' . $file; |
|
270 | + $destination = dirname($modulePath).'/'.$file; |
|
271 | 271 | $injection = "\ndrupal_add_js('$destination', array('every_page' => TRUE));"; |
272 | 272 | |
273 | 273 | if ($delete) { |
@@ -277,13 +277,13 @@ discard block |
||
277 | 277 | $replace = ''; |
278 | 278 | } else { |
279 | 279 | static::fileUnmanagedCopy( |
280 | - str_replace('Context', 'JavaScript', __DIR__) . '/' . $file, |
|
280 | + str_replace('Context', 'JavaScript', __DIR__).'/'.$file, |
|
281 | 281 | $destination, |
282 | 282 | FILE_EXISTS_REPLACE |
283 | 283 | ); |
284 | 284 | |
285 | 285 | $search = 'system_add_module_assets();'; |
286 | - $replace = $search . $injection; |
|
286 | + $replace = $search.$injection; |
|
287 | 287 | } |
288 | 288 | |
289 | 289 | file_put_contents($modulePath, str_replace($search, $replace, file_get_contents($modulePath))); |
@@ -290,8 +290,8 @@ |
||
290 | 290 | } |
291 | 291 | |
292 | 292 | $url += [ |
293 | - // When URL starts from "//" the "scheme" key will not exists. |
|
294 | - 'scheme' => 'http', |
|
293 | + // When URL starts from "//" the "scheme" key will not exists. |
|
294 | + 'scheme' => 'http', |
|
295 | 295 | ]; |
296 | 296 | |
297 | 297 | // Check scheme. |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | { |
281 | 281 | // Obtain base URL when path is empty, or not starts from "//" or "http". |
282 | 282 | if (empty($path) || strpos($path, '//') !== 0 && strpos($path, 'http') !== 0) { |
283 | - $path = rtrim($this->getMinkParameter('base_url'), '/') . '/' . ltrim($path, '/'); |
|
283 | + $path = rtrim($this->getMinkParameter('base_url'), '/').'/'.ltrim($path, '/'); |
|
284 | 284 | } |
285 | 285 | |
286 | 286 | $url = parse_url(strtolower($path)); |
@@ -299,13 +299,13 @@ discard block |
||
299 | 299 | throw new \InvalidArgumentException(sprintf('%s - is not valid scheme.', $url['scheme'])); |
300 | 300 | } |
301 | 301 | |
302 | - $path = $url['scheme'] . '://'; |
|
302 | + $path = $url['scheme'].'://'; |
|
303 | 303 | |
304 | 304 | if (isset($url['user'], $url['pass'])) { |
305 | 305 | // Encode special characters in username and password. Useful |
306 | 306 | // when some item contain something like "@" symbol. |
307 | 307 | foreach (['user' => ':', 'pass' => '@'] as $part => $suffix) { |
308 | - $path .= rawurlencode($url[$part]) . $suffix; |
|
308 | + $path .= rawurlencode($url[$part]).$suffix; |
|
309 | 309 | } |
310 | 310 | } |
311 | 311 | |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | // Append additional URL components. |
315 | 315 | foreach (['port' => ':', 'path' => '', 'query' => '?', 'fragment' => '#'] as $part => $prefix) { |
316 | 316 | if (isset($url[$part])) { |
317 | - $path .= $prefix . $url[$part]; |
|
317 | + $path .= $prefix.$url[$part]; |
|
318 | 318 | } |
319 | 319 | } |
320 | 320 |