@@ -1,7 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -use Drupal\user\Entity\User; |
|
| 4 | - |
|
| 5 | 3 | /** |
| 6 | 4 | * @file |
| 7 | 5 | * Contains core functionality for the DF distribution. |
@@ -38,9 +38,9 @@ |
||
| 38 | 38 | * @When I instantiate the :plugin_id block in :theme |
| 39 | 39 | */ |
| 40 | 40 | public function instantiateBlock($plugin_id, $theme) { |
| 41 | - $this->visitPath('/admin/structure/block/add/' . $plugin_id . '/' . $theme); |
|
| 41 | + $this->visitPath('/admin/structure/block/add/'.$plugin_id.'/'.$theme); |
|
| 42 | 42 | |
| 43 | - $id = uniqid($theme . '_'); |
|
| 43 | + $id = uniqid($theme.'_'); |
|
| 44 | 44 | $this->minkContext->fillField('id', $id); |
| 45 | 45 | |
| 46 | 46 | /** @var UndoContext $undo */ |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | if ($result != $count) { |
| 47 | 47 | throw new ExpectationException( |
| 48 | - '"' . $selector . '" matched ' . $result . ' element(s), expected ' . $count . '.', |
|
| 48 | + '"'.$selector.'" matched '.$result.' element(s), expected '.$count.'.', |
|
| 49 | 49 | $session->getDriver() |
| 50 | 50 | ); |
| 51 | 51 | } |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | |
| 72 | 72 | if ($result < $count) { |
| 73 | 73 | throw new ExpectationException( |
| 74 | - '"' . $selector . '" matched ' . $result . ' element(s), expected at least ' . $count . '.', |
|
| 74 | + '"'.$selector.'" matched '.$result.' element(s), expected at least '.$count.'.', |
|
| 75 | 75 | $session->getDriver() |
| 76 | 76 | ); |
| 77 | 77 | } |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | |
| 107 | 107 | if (trim($content)) { |
| 108 | 108 | throw new ExpectationException( |
| 109 | - 'Expected ' . $selector . ' to be empty but it is not.', |
|
| 109 | + 'Expected '.$selector.' to be empty but it is not.', |
|
| 110 | 110 | $this->getSession()->getDriver() |
| 111 | 111 | ); |
| 112 | 112 | } |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | $entity_type_manager = \Drupal::entityTypeManager(); |
| 164 | 164 | |
| 165 | 165 | for ($i = 0; $i < $count; $i++) { |
| 166 | - $uri = $random->image(uniqid('public://random_') . '.png', '240x240', '640x480'); |
|
| 166 | + $uri = $random->image(uniqid('public://random_').'.png', '240x240', '640x480'); |
|
| 167 | 167 | |
| 168 | 168 | /** @var \Drupal\file\FileInterface $file */ |
| 169 | 169 | $file = $entity_type_manager->getStorage('file')->create(['uri' => $uri]); |
@@ -200,8 +200,7 @@ |
||
| 200 | 200 | while (true) { |
| 201 | 201 | try { |
| 202 | 202 | $driver->getWebDriverSession()->accept_alert(); |
| 203 | - } |
|
| 204 | - catch (NoAlertOpenError $e) { |
|
| 203 | + } catch (NoAlertOpenError $e) { |
|
| 205 | 204 | break; |
| 206 | 205 | } |
| 207 | 206 | } |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | // Assert that the category exists... |
| 117 | 117 | $link = $this->assertSession() |
| 118 | 118 | ->elementExists('css', |
| 119 | - '.ipe-category[data-category="' . $category . '"]', |
|
| 119 | + '.ipe-category[data-category="'.$category.'"]', |
|
| 120 | 120 | $tab |
| 121 | 121 | ); |
| 122 | 122 | |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | return $this->assertSession() |
| 148 | 148 | ->elementExists( |
| 149 | 149 | 'css', |
| 150 | - '.ipe-block-plugin a[data-plugin-id="' . $plugin_id . '"]', |
|
| 150 | + '.ipe-block-plugin a[data-plugin-id="'.$plugin_id.'"]', |
|
| 151 | 151 | $category ? $this->openCategory($category) : $this->getActiveTab() |
| 152 | 152 | ); |
| 153 | 153 | } |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | $this->assertSession() |
| 168 | 168 | ->elementNotExists( |
| 169 | 169 | 'css', |
| 170 | - '.ipe-block-plugin a[data-plugin-id="' . $plugin_id . '"]', |
|
| 170 | + '.ipe-block-plugin a[data-plugin-id="'.$plugin_id.'"]', |
|
| 171 | 171 | $category ? $this->openCategory($category) : $this->getActiveTab() |
| 172 | 172 | ); |
| 173 | 173 | } |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Acquia\DFExtension\Context; |
| 4 | 4 | |
| 5 | -use Behat\Mink\Driver\Selenium2Driver; |
|
| 6 | 5 | use Drupal\DrupalExtension\Context\DrupalSubContextBase; |
| 7 | 6 | use Drupal\DrupalExtension\Context\MinkContext; |
| 8 | 7 | |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | * @Then CKEditor :id should exist |
| 27 | 27 | */ |
| 28 | 28 | public function assertEditor($id = NULL) { |
| 29 | - $js = "CKEDITOR.instances['" . ($id ?: $this->getDefault()) . "']"; |
|
| 29 | + $js = "CKEDITOR.instances['".($id ?: $this->getDefault())."']"; |
|
| 30 | 30 | |
| 31 | 31 | $this->getSession()->wait(10000, "$js.status === 'ready'"); |
| 32 | 32 | |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | |
| 69 | 69 | if ($position == FALSE) { |
| 70 | 70 | throw new ExpectationException( |
| 71 | - 'Expected CKEditor ' . $id . ' to contain "' . $text . '".', |
|
| 71 | + 'Expected CKEditor '.$id.' to contain "'.$text.'".', |
|
| 72 | 72 | $this->getSession()->getDriver() |
| 73 | 73 | ); |
| 74 | 74 | } |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | |
| 94 | 94 | if ($match == 0) { |
| 95 | 95 | throw new ExpectationException( |
| 96 | - 'Expected CKEditor ' . $id . ' to match "' . $expr . '".', |
|
| 96 | + 'Expected CKEditor '.$id.' to match "'.$expr.'".', |
|
| 97 | 97 | $this->getSession()->getDriver() |
| 98 | 98 | ); |
| 99 | 99 | } |
@@ -134,11 +134,11 @@ discard block |
||
| 134 | 134 | |
| 135 | 135 | $session = $this->getSession(); |
| 136 | 136 | |
| 137 | - $return = Json::decode($session->evaluateScript("$js.execCommand('$command', " . Json::encode($data) . ')')); |
|
| 137 | + $return = Json::decode($session->evaluateScript("$js.execCommand('$command', ".Json::encode($data).')')); |
|
| 138 | 138 | |
| 139 | 139 | if (empty($return)) { |
| 140 | 140 | throw new ExpectationException( |
| 141 | - 'CKEditor command ' . $command . ' returned ' . var_export($return, TRUE) . ', expected truthy.', |
|
| 141 | + 'CKEditor command '.$command.' returned '.var_export($return, TRUE).', expected truthy.', |
|
| 142 | 142 | $session->getDriver() |
| 143 | 143 | ); |
| 144 | 144 | } |
@@ -42,8 +42,7 @@ |
||
| 42 | 42 | // If the display was created anew, its previous status is effectively |
| 43 | 43 | // FALSE. |
| 44 | 44 | $original_status = FALSE; |
| 45 | - } |
|
| 46 | - else { |
|
| 45 | + } else { |
|
| 47 | 46 | $original_status = $display->status(); |
| 48 | 47 | } |
| 49 | 48 | |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | $session->switchToWindow(); |
| 43 | 43 | // @TODO: Make this smarter, because we can't be sure that #edit-submit |
| 44 | 44 | // exists at all, or that it's the correct submit button. |
| 45 | - $session->executeScript('frames["' . $frame . '"].document.forms[0].querySelector("#edit-submit").click()'); |
|
| 45 | + $session->executeScript('frames["'.$frame.'"].document.forms[0].querySelector("#edit-submit").click()'); |
|
| 46 | 46 | sleep(10); |
| 47 | 47 | $this->minkContext->iWaitForAjaxToFinish(); |
| 48 | 48 | } |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | */ |
| 92 | 92 | public function selectItem($n, $browser_id = NULL) { |
| 93 | 93 | if ($browser_id) { |
| 94 | - $selector = 'form#entity-browser-' . Html::cleanCssIdentifier($browser_id) . '-form'; |
|
| 94 | + $selector = 'form#entity-browser-'.Html::cleanCssIdentifier($browser_id).'-form'; |
|
| 95 | 95 | } |
| 96 | 96 | else { |
| 97 | 97 | $selector = 'form[data-entity-browser-uuid]'; |
@@ -71,8 +71,7 @@ discard block |
||
| 71 | 71 | $session->switchToIFrame('entity_browser_iframe_image_browser'); |
| 72 | 72 | // This might be vestigial. |
| 73 | 73 | sleep(10); |
| 74 | - } |
|
| 75 | - else { |
|
| 74 | + } else { |
|
| 76 | 75 | throw new ElementNotFoundException($session->getDriver(), 'collapsible element'); |
| 77 | 76 | } |
| 78 | 77 | } |
@@ -92,8 +91,7 @@ discard block |
||
| 92 | 91 | public function selectItem($n, $browser_id = NULL) { |
| 93 | 92 | if ($browser_id) { |
| 94 | 93 | $selector = 'form#entity-browser-' . Html::cleanCssIdentifier($browser_id) . '-form'; |
| 95 | - } |
|
| 96 | - else { |
|
| 94 | + } else { |
|
| 97 | 95 | $selector = 'form[data-entity-browser-uuid]'; |
| 98 | 96 | } |
| 99 | 97 | |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | /** @var Drupal\migrate_source_csv\CSVFileObject $iterator */ |
| 23 | 23 | $iterator = $source->initializeIterator(); |
| 24 | 24 | $base_path = $iterator->getPath(); |
| 25 | - $filename = $base_path . '/' . $iterator->getFilename(); |
|
| 25 | + $filename = $base_path.'/'.$iterator->getFilename(); |
|
| 26 | 26 | |
| 27 | 27 | $destination = $migration->getDestinationPlugin(); |
| 28 | 28 | $entity_type = explode(':', $destination->getPluginId())[1]; |
@@ -73,14 +73,14 @@ discard block |
||
| 73 | 73 | $entity = $entity_storage->load($id); |
| 74 | 74 | |
| 75 | 75 | // See if a Panelizer config file exists for this Node. |
| 76 | - $panels_file = $base_path . '/panelizer.panels_display.' . $entity_type . '.' . $entity->uuid() . '.yml'; |
|
| 76 | + $panels_file = $base_path.'/panelizer.panels_display.'.$entity_type.'.'.$entity->uuid().'.yml'; |
|
| 77 | 77 | if (file_exists($panels_file) && isset($entity->panelizer)) { |
| 78 | 78 | $yaml = file_get_contents($panels_file); |
| 79 | 79 | |
| 80 | 80 | $panels_display = Yaml::parse($yaml); |
| 81 | 81 | |
| 82 | 82 | // The storage ID isn't based on UUIDs, unfortunately. Hotswap it with current info. |
| 83 | - $panels_display['storage_id'] = $entity_type . ':' . $entity->id() . ':full:' . $entity->getRevisionId(); |
|
| 83 | + $panels_display['storage_id'] = $entity_type.':'.$entity->id().':full:'.$entity->getRevisionId(); |
|
| 84 | 84 | |
| 85 | 85 | // Set the Panels Display to match what's defined in YAML. |
| 86 | 86 | $entity->panelizer->panels_display = $panels_display; |
@@ -68,8 +68,7 @@ discard block |
||
| 68 | 68 | if (isset($options['langcode'])) { |
| 69 | 69 | $url_options['language'] = \Drupal::languageManager()->getLanguage($options['langcode']); |
| 70 | 70 | $langcode = $options['langcode']; |
| 71 | - } |
|
| 72 | - else { |
|
| 71 | + } else { |
|
| 73 | 72 | $langcode = NULL; |
| 74 | 73 | } |
| 75 | 74 | |
@@ -93,8 +92,7 @@ discard block |
||
| 93 | 92 | $replacements[$original] = Url::fromRoute('entity.node.latest_version', [ |
| 94 | 93 | 'node' => $node->id(), |
| 95 | 94 | ], $url_options)->toString(); |
| 96 | - } |
|
| 97 | - else { |
|
| 95 | + } else { |
|
| 98 | 96 | $replacements[$original] = $latest->toUrl('canonical', $url_options)->toString(); |
| 99 | 97 | } |
| 100 | 98 | break; |