@@ -11,45 +11,45 @@ discard block |
||
| 11 | 11 | */ |
| 12 | 12 | class EmbedButtonTest extends JavascriptTestBase { |
| 13 | 13 | |
| 14 | - /** |
|
| 15 | - * {@inheritdoc} |
|
| 16 | - */ |
|
| 17 | - public static $modules = [ |
|
| 14 | + /** |
|
| 15 | + * {@inheritdoc} |
|
| 16 | + */ |
|
| 17 | + public static $modules = [ |
|
| 18 | 18 | 'node', |
| 19 | 19 | 'path', |
| 20 | 20 | 'text', |
| 21 | - ]; |
|
| 21 | + ]; |
|
| 22 | 22 | |
| 23 | - /** |
|
| 24 | - * {@inheritdoc} |
|
| 25 | - */ |
|
| 26 | - public function setUp() { |
|
| 23 | + /** |
|
| 24 | + * {@inheritdoc} |
|
| 25 | + */ |
|
| 26 | + public function setUp() { |
|
| 27 | 27 | parent::setUp(); |
| 28 | 28 | // Manually installing modules to preserve the order. |
| 29 | 29 | $this->installModule('media_embed_test'); |
| 30 | 30 | $this->installModule('media'); |
| 31 | 31 | $adminUser = $this->drupalCreateUser([ |
| 32 | - 'access content', |
|
| 33 | - 'use text format basic_html', |
|
| 34 | - 'use text format full_html', |
|
| 35 | - 'access media_embed entity browser pages', |
|
| 36 | - 'view media', |
|
| 37 | - 'create media', |
|
| 38 | - 'update media', |
|
| 39 | - 'update any media', |
|
| 40 | - 'delete media', |
|
| 41 | - 'delete any media', |
|
| 42 | - 'access media overview', |
|
| 43 | - 'create page content', |
|
| 44 | - 'edit any page content', |
|
| 32 | + 'access content', |
|
| 33 | + 'use text format basic_html', |
|
| 34 | + 'use text format full_html', |
|
| 35 | + 'access media_embed entity browser pages', |
|
| 36 | + 'view media', |
|
| 37 | + 'create media', |
|
| 38 | + 'update media', |
|
| 39 | + 'update any media', |
|
| 40 | + 'delete media', |
|
| 41 | + 'delete any media', |
|
| 42 | + 'access media overview', |
|
| 43 | + 'create page content', |
|
| 44 | + 'edit any page content', |
|
| 45 | 45 | ]); |
| 46 | 46 | $this->drupalLogin($adminUser); |
| 47 | - } |
|
| 47 | + } |
|
| 48 | 48 | |
| 49 | - /** |
|
| 50 | - * Tests that the entity embed dialog is working. |
|
| 51 | - */ |
|
| 52 | - public function testMediaEmbedDialog() { |
|
| 49 | + /** |
|
| 50 | + * Tests that the entity embed dialog is working. |
|
| 51 | + */ |
|
| 52 | + public function testMediaEmbedDialog() { |
|
| 53 | 53 | // Find the button and click it to see if the modal opens. |
| 54 | 54 | $this->drupalGet('node/add/page'); |
| 55 | 55 | $this->find('.cke_button__media')->click(); |
@@ -71,38 +71,38 @@ discard block |
||
| 71 | 71 | $this->assertEquals(200, $this->getSession()->getStatusCode()); |
| 72 | 72 | $filter = $this->getSession()->getPage()->find('css', 'input[name="name"]'); |
| 73 | 73 | $this->assertTrue($filter, "Found filter"); |
| 74 | - } |
|
| 74 | + } |
|
| 75 | 75 | |
| 76 | - /** |
|
| 77 | - * Installs the module using module_handler service. |
|
| 78 | - * |
|
| 79 | - * @param string $module_name |
|
| 80 | - * Name of the module to install. |
|
| 81 | - */ |
|
| 82 | - public function installModule($module_name) { |
|
| 76 | + /** |
|
| 77 | + * Installs the module using module_handler service. |
|
| 78 | + * |
|
| 79 | + * @param string $module_name |
|
| 80 | + * Name of the module to install. |
|
| 81 | + */ |
|
| 82 | + public function installModule($module_name) { |
|
| 83 | 83 | if (!$this->container->get('module_handler')->moduleExists($module_name)) { |
| 84 | - $this->container->get('module_installer')->install(array($module_name)); |
|
| 84 | + $this->container->get('module_installer')->install(array($module_name)); |
|
| 85 | + } |
|
| 85 | 86 | } |
| 86 | - } |
|
| 87 | 87 | |
| 88 | - /** |
|
| 89 | - * Wait for AJAX. |
|
| 90 | - */ |
|
| 91 | - protected function wait() { |
|
| 88 | + /** |
|
| 89 | + * Wait for AJAX. |
|
| 90 | + */ |
|
| 91 | + protected function wait() { |
|
| 92 | 92 | $this->getSession()->wait(20000, '(0 === jQuery.active)'); |
| 93 | - } |
|
| 93 | + } |
|
| 94 | 94 | |
| 95 | - /** |
|
| 96 | - * Find an element based on a CSS selector. |
|
| 97 | - * |
|
| 98 | - * @param string $css_selector |
|
| 99 | - * A css selector to find an element for. |
|
| 100 | - * |
|
| 101 | - * @return \Behat\Mink\Element\NodeElement|null |
|
| 102 | - * The found element or null. |
|
| 103 | - */ |
|
| 104 | - protected function find($css_selector) { |
|
| 95 | + /** |
|
| 96 | + * Find an element based on a CSS selector. |
|
| 97 | + * |
|
| 98 | + * @param string $css_selector |
|
| 99 | + * A css selector to find an element for. |
|
| 100 | + * |
|
| 101 | + * @return \Behat\Mink\Element\NodeElement|null |
|
| 102 | + * The found element or null. |
|
| 103 | + */ |
|
| 104 | + protected function find($css_selector) { |
|
| 105 | 105 | return $this->getSession()->getPage()->find('css', $css_selector); |
| 106 | - } |
|
| 106 | + } |
|
| 107 | 107 | |
| 108 | 108 | } |