Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #3128263: Move thunder_amp theme to d.o. #197

Merged
merged 6 commits into from Apr 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 1 addition & 8 deletions composer.json
Expand Up @@ -60,9 +60,6 @@
"drupal/diff": {
"Back button for comparison page": "https://www.drupal.org/files/issues/back_button_for-2853193-4.patch"
},
"drupal/amp": {
"Missing schema": "https://www.drupal.org/files/issues/missing_schema_for-2878769-3.patch"
},
"drupal/entity_browser": {
"Provide inline entity form FieldWidgetDisplay": "https://www.drupal.org/files/issues/2019-07-04/2858438_17.patch",
"Re-order + remove broken with the Entity Reference (and File) widget": "https://www.drupal.org/files/issues/2020-03-30/2851580-83.patch"
Expand All @@ -82,8 +79,6 @@
"require": {
"composer/installers": "^1.2",
"cweagans/composer-patches": "^1.6.5",
"drupal/amp": "1.2",
"drupal/amptheme": "^1.1",
"marc1706/fast-image-size": "^1.1.0",
"oomphinc/composer-installers-extender": "^1.1",
"drupal/access_unpublished": "^1.0-alpha8",
Expand Down Expand Up @@ -137,6 +132,7 @@
"drupal/slick": "^2.0-rc3",
"drupal/slick_media": "^2.0-alpha2",
"drupal/thunder_admin": "^3.0",
"drupal/thunder_amp": "^1.0-beta2",
"drupal/thunder_fia": "^1.0",
"drupal/token": "^1.0",
"drupal/update_helper": "^1.3",
Expand Down Expand Up @@ -170,8 +166,5 @@
"drupal/config_profile": "^1.0",
"mglaman/phpstan-drupal": "~0.12.0",
"phpstan/phpstan-deprecation-rules": "~0.12.0"
},
"conflict": {
"masterminds/html5": "^2.4.0"
}
}
2 changes: 2 additions & 0 deletions drupal-org.make
Expand Up @@ -119,6 +119,8 @@ projects[thunder_admin][type] = theme
projects[thunder_admin][version] = 3
projects[thunder_fia][type] = module
projects[thunder_fia][version] = 1
projects[thunder_amp][type] = module
projects[thunder_amp][version] = 1
projects[token][type] = module
projects[token][version] = 1
projects[update_helper][type] = module
Expand Down
35 changes: 35 additions & 0 deletions tests/src/FunctionalJavascript/ModuleIntegrationTest.php
Expand Up @@ -234,6 +234,41 @@ public function testAmpIntegration() {
$this->getSession()->executeScript('AMPValidationSuccess = false; console.info = function(message) { if (message === "AMP validation successful.") { AMPValidationSuccess = true } }; amp.validator.validateUrlAndLog(document.location.href, document);');
$this->assertJsCondition('AMPValidationSuccess === true', 10000, 'AMP validation successful.');

$this->drupalLogout();
$this->drupalLogin($this->rootUser);

// Verify that the Site branding block is in the header region.
$this->drupalGet('admin/structure/block/list/thunder_amp');
$element = $this->xpath("//tr[contains(@data-drupal-selector, :block) and contains(@class, :status)]//select/option[@selected and @value=:region]",
[
':block' => 'edit-blocks-thunder-amp-branding',
':status' => 'block-enabled',
':region' => 'header',
]
);
$this->assertNotEmpty($element);

// Verify that the Title block is in the content region.
$this->drupalGet('admin/structure/block/list/thunder_amp');
$element = $this->xpath("//tr[contains(@data-drupal-selector, :block) and contains(@class, :status)]//select/option[@selected and @value=:region]",
[
':block' => 'edit-blocks-thunder-amp-page-title',
':status' => 'block-enabled',
':region' => 'content',
]
);
$this->assertNotEmpty($element);

// Verify that the Content block is in the content region.
$this->drupalGet('admin/structure/block/list/thunder_amp');
$element = $this->xpath("//tr[contains(@data-drupal-selector, :block) and contains(@class, :status)]//select/option[@selected and @value=:region]",
[
':block' => 'edit-blocks-thunder-amp-content',
':status' => 'block-enabled',
':region' => 'content',
]
);
$this->assertNotEmpty($element);
}

/**
Expand Down
16 changes: 16 additions & 0 deletions tests/src/Traits/ThunderTestTrait.php
Expand Up @@ -9,6 +9,7 @@
use Drupal\Core\File\FileSystemInterface;
use Drupal\Core\Site\Settings;
use Drupal\dblog\Controller\DbLogController;
use Drupal\user\Entity\User;
use Symfony\Component\HttpFoundation\Request;

/**
Expand Down Expand Up @@ -48,6 +49,21 @@ public function installDrupal() {
$this->installDefaultThemeFromClassProperty($container);
$this->installModulesFromClassProperty($container);
$this->rebuildAll();
$this->replaceUser1();
}

/**
* Replace User 1 with the user created here.
*/
protected function replaceUser1() {
/** @var \Drupal\user\UserInterface $account */
// @todo: Saving the account before the update is problematic.
// https://www.drupal.org/node/2560237
$account = User::load(1);
$account->setPassword($this->rootUser->pass_raw);
$account->setEmail($this->rootUser->getEmail());
$account->setUsername($this->rootUser->getAccountName());
$account->save();
}

/**
Expand Down
26 changes: 0 additions & 26 deletions themes/thunder_amp/README.md

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.