diff --git a/amp.install b/amp.install index 8465930..4aef3de 100644 --- a/amp.install +++ b/amp.install @@ -163,7 +163,7 @@ function amp_update_8005() { 'targetEntityType' => 'node', 'bundle' => $bundle ); - if ($view_displays = \Drupal::entityManager()->getStorage('entity_view_display')->loadByProperties($properties)) { + if ($view_displays = \Drupal::entityTypeManager()->getStorage('entity_view_display')->loadByProperties($properties)) { foreach ($view_displays as $view_display) { if ($component = $view_display->getComponent($field_name)) { // Map old formatter settings to new ones. @@ -202,7 +202,7 @@ function amp_update_8005() { 'targetEntityType' => 'node', 'bundle' => $bundle ); - if ($view_displays = \Drupal::entityManager()->getStorage('entity_view_display')->loadByProperties($properties)) { + if ($view_displays = \Drupal::entityTypeManager()->getStorage('entity_view_display')->loadByProperties($properties)) { foreach ($view_displays as $view_display) { if ($component = $view_display->getComponent($field_name)) { // Map old formatter settings to new ones. diff --git a/composer.json b/composer.json index 08a0a9d..40c64f8 100644 --- a/composer.json +++ b/composer.json @@ -14,6 +14,7 @@ "lullabot/amp": "^1.0.0" }, "require-dev": { - "drupal/amptheme": "^3.0" + "drupal/amptheme": "^3.0", + "phpunit/phpunit": "^4.8.35 || ^6.5" } } diff --git a/modules/amp_adsense/tests/src/Functional/BasicTestCase.php b/modules/amp_adsense/tests/src/Functional/BasicTestCase.php new file mode 100644 index 0000000..77437bf --- /dev/null +++ b/modules/amp_adsense/tests/src/Functional/BasicTestCase.php @@ -0,0 +1,50 @@ +getEditable('system.site') + ->set('page.front', '/node') + ->save(TRUE); + } + + /** + * Make sure the site still works. For now just check the front page. + */ + public function testTheSiteStillWorks() { + // Load the front page. + $this->drupalGet(''); + + // Confirm that the site didn't throw a server error or something else. + $this->assertSession()->statusCodeEquals(200); + + // Confirm that the front page contains the standard text. + $this->assertText('Welcome to Drupal'); + } + +} diff --git a/modules/amp_rdf/amp_rdf.module b/modules/amp_rdf/amp_rdf.module index 3070dc4..17c9149 100644 --- a/modules/amp_rdf/amp_rdf.module +++ b/modules/amp_rdf/amp_rdf.module @@ -1,6 +1,6 @@ getEditable('system.site') + ->set('page.front', '/node') + ->save(TRUE); + } + + /** + * Make sure the site still works. For now just check the front page. + */ + public function testTheSiteStillWorks() { + // Load the front page. + $this->drupalGet(''); + + // Confirm that the site didn't throw a server error or something else. + $this->assertSession()->statusCodeEquals(200); + + // Confirm that the front page contains the standard text. + $this->assertText('Welcome to Drupal'); + } + +} diff --git a/modules/amp_toolbar/tests/src/Functional/BasicTestCase.php b/modules/amp_toolbar/tests/src/Functional/BasicTestCase.php new file mode 100644 index 0000000..ccd3130 --- /dev/null +++ b/modules/amp_toolbar/tests/src/Functional/BasicTestCase.php @@ -0,0 +1,51 @@ +getEditable('system.site') + ->set('page.front', '/node') + ->save(TRUE); + } + + /** + * Make sure the site still works. For now just check the front page. + */ + public function testTheSiteStillWorks() { + // Load the front page. + $this->drupalGet(''); + + // Confirm that the site didn't throw a server error or something else. + $this->assertSession()->statusCodeEquals(200); + + // Confirm that the front page contains the standard text. + $this->assertText('Welcome to Drupal'); + } + +} diff --git a/tests/src/Functional/BasicTestCase.php b/tests/src/Functional/BasicTestCase.php new file mode 100644 index 0000000..0a9ca4f --- /dev/null +++ b/tests/src/Functional/BasicTestCase.php @@ -0,0 +1,49 @@ +getEditable('system.site') + ->set('page.front', '/node') + ->save(TRUE); + } + + /** + * Make sure the site still works. For now just check the front page. + */ + public function testTheSiteStillWorks() { + // Load the front page. + $this->drupalGet(''); + + // Confirm that the site didn't throw a server error or something else. + $this->assertSession()->statusCodeEquals(200); + + // Confirm that the front page contains the standard text. + $this->assertText('Welcome to Drupal'); + } + +}