diff --git a/core/modules/aggregator/src/Tests/AddFeedTest.php b/core/modules/aggregator/tests/src/Functional/AddFeedTest.php similarity index 98% rename from core/modules/aggregator/src/Tests/AddFeedTest.php rename to core/modules/aggregator/tests/src/Functional/AddFeedTest.php index 4dfeb955720aefdcbb6336b3a1e816cd4c75dd7f..e4f63ea73105c326eaeb6d819ce72c59b66b9070 100644 --- a/core/modules/aggregator/src/Tests/AddFeedTest.php +++ b/core/modules/aggregator/tests/src/Functional/AddFeedTest.php @@ -1,6 +1,6 @@ <?php -namespace Drupal\aggregator\Tests; +namespace Drupal\Tests\aggregator\Functional; /** * Add feed test. diff --git a/core/modules/aggregator/src/Tests/AggregatorAdminTest.php b/core/modules/aggregator/tests/src/Functional/AggregatorAdminTest.php similarity index 83% rename from core/modules/aggregator/src/Tests/AggregatorAdminTest.php rename to core/modules/aggregator/tests/src/Functional/AggregatorAdminTest.php index 01898b6cf09dca27b44be1b849e28e7d1719d251..4b278d6247199fbda196dd9c900608ff33054bca 100644 --- a/core/modules/aggregator/src/Tests/AggregatorAdminTest.php +++ b/core/modules/aggregator/tests/src/Functional/AggregatorAdminTest.php @@ -1,6 +1,6 @@ <?php -namespace Drupal\aggregator\Tests; +namespace Drupal\Tests\aggregator\Functional; /** * Tests aggregator admin pages. @@ -67,18 +67,22 @@ public function testOverviewPage() { // Check if the amount of feeds in the overview matches the amount created. $this->assertEqual(1, count($result), 'Created feed is found in the overview'); // Check if the fields in the table match with what's expected. - $this->assertEqual($feed->label(), (string) $result[0]->td[0]->a); + $link = $this->xpath('//table/tbody/tr//td[1]/a'); + $this->assertEquals($feed->label(), $link[0]->getText()); $count = $this->container->get('entity.manager')->getStorage('aggregator_item')->getItemCount($feed); - $this->assertEqual(\Drupal::translation()->formatPlural($count, '1 item', '@count items'), (string) $result[0]->td[1]); + $td = $this->xpath('//table/tbody/tr//td[2]'); + $this->assertEquals(\Drupal::translation()->formatPlural($count, '1 item', '@count items'), $td[0]->getText()); // Update the items of the first feed. $feed->refreshItems(); $this->drupalGet('admin/config/services/aggregator'); $result = $this->xpath('//table/tbody/tr'); // Check if the fields in the table match with what's expected. - $this->assertEqual($feed->label(), (string) $result[0]->td[0]->a); + $link = $this->xpath('//table/tbody/tr//td[1]/a'); + $this->assertEquals($feed->label(), $link[0]->getText()); $count = $this->container->get('entity.manager')->getStorage('aggregator_item')->getItemCount($feed); - $this->assertEqual(\Drupal::translation()->formatPlural($count, '1 item', '@count items'), (string) $result[0]->td[1]); + $td = $this->xpath('//table/tbody/tr//td[2]'); + $this->assertEquals(\Drupal::translation()->formatPlural($count, '1 item', '@count items'), $td[0]->getText()); } } diff --git a/core/modules/aggregator/src/Tests/AggregatorCronTest.php b/core/modules/aggregator/tests/src/Functional/AggregatorCronTest.php similarity index 93% rename from core/modules/aggregator/src/Tests/AggregatorCronTest.php rename to core/modules/aggregator/tests/src/Functional/AggregatorCronTest.php index 9ebb2d25c00c36563b9913f7dffcb8240e8b6ef7..bb7c90ae32f238f02fe266ee3270e064755eb64d 100644 --- a/core/modules/aggregator/src/Tests/AggregatorCronTest.php +++ b/core/modules/aggregator/tests/src/Functional/AggregatorCronTest.php @@ -1,6 +1,8 @@ <?php -namespace Drupal\aggregator\Tests; +namespace Drupal\Tests\aggregator\Functional; + +use Drupal\Tests\Traits\Core\CronRunTrait; /** * Update feeds on cron. @@ -8,6 +10,9 @@ * @group aggregator */ class AggregatorCronTest extends AggregatorTestBase { + + use CronRunTrait; + /** * Adds feeds and updates them via cron process. */ diff --git a/core/modules/aggregator/src/Tests/AggregatorRenderingTest.php b/core/modules/aggregator/tests/src/Functional/AggregatorRenderingTest.php similarity index 91% rename from core/modules/aggregator/src/Tests/AggregatorRenderingTest.php rename to core/modules/aggregator/tests/src/Functional/AggregatorRenderingTest.php index de7e401058b23eb403ab9afc19fe3fdb15c829fb..37e6470847f5f5c5f490c57f57cb8b0d4735d6f6 100644 --- a/core/modules/aggregator/src/Tests/AggregatorRenderingTest.php +++ b/core/modules/aggregator/tests/src/Functional/AggregatorRenderingTest.php @@ -1,6 +1,6 @@ <?php -namespace Drupal\aggregator\Tests; +namespace Drupal\Tests\aggregator\Functional; use Drupal\Component\Utility\SafeMarkup; use Drupal\views\Entity\View; @@ -132,10 +132,14 @@ public function testFeedPage() { // Check the opml aggregator page. $this->drupalGet('aggregator/opml'); - $outline = $this->xpath('//outline[1]'); - $this->assertEqual($outline[0]['type'], 'rss', 'The correct type attribute is used for rss OPML.'); - $this->assertEqual($outline[0]['text'], $feed->label(), 'The correct text attribute is used for rss OPML.'); - $this->assertEqual($outline[0]['xmlurl'], $feed->getUrl(), 'The correct xmlUrl attribute is used for rss OPML.'); + $content = $this->getSession()->getPage()->getContent(); + // We can't use Mink xpath queries here because it only supports HTML pages, + // but we are dealing with XML here. + $xml = simplexml_load_string($content); + $attributes = $xml->xpath('//outline[1]')[0]->attributes(); + $this->assertEquals('rss', $attributes->type); + $this->assertEquals($feed->label(), $attributes->text); + $this->assertEquals($feed->getUrl(), $attributes->xmlUrl); // Check for the presence of a pager. $this->drupalGet('aggregator/sources/' . $feed->id()); diff --git a/core/modules/aggregator/src/Tests/FeedAdminDisplayTest.php b/core/modules/aggregator/tests/src/Functional/FeedAdminDisplayTest.php similarity index 98% rename from core/modules/aggregator/src/Tests/FeedAdminDisplayTest.php rename to core/modules/aggregator/tests/src/Functional/FeedAdminDisplayTest.php index 46366b4957d74a5e08dc8ded505d5d94a907a692..e057be6e613bee28705190ce4be5eae1103b2458 100644 --- a/core/modules/aggregator/src/Tests/FeedAdminDisplayTest.php +++ b/core/modules/aggregator/tests/src/Functional/FeedAdminDisplayTest.php @@ -1,6 +1,6 @@ <?php -namespace Drupal\aggregator\Tests; +namespace Drupal\Tests\aggregator\Functional; /** * Tests the display of a feed on the Aggregator list page. diff --git a/core/modules/aggregator/src/Tests/FeedLanguageTest.php b/core/modules/aggregator/tests/src/Functional/FeedLanguageTest.php similarity index 95% rename from core/modules/aggregator/src/Tests/FeedLanguageTest.php rename to core/modules/aggregator/tests/src/Functional/FeedLanguageTest.php index 98d04fa5c1319e5a9ba25460311fd4135f65f704..7e3d672c06c1f27464e204dae155b62839e4ab4f 100644 --- a/core/modules/aggregator/src/Tests/FeedLanguageTest.php +++ b/core/modules/aggregator/tests/src/Functional/FeedLanguageTest.php @@ -1,8 +1,9 @@ <?php -namespace Drupal\aggregator\Tests; +namespace Drupal\Tests\aggregator\Functional; use Drupal\language\Entity\ConfigurableLanguage; +use Drupal\Tests\Traits\Core\CronRunTrait; /** * Tests aggregator feeds in multiple languages. @@ -11,6 +12,8 @@ */ class FeedLanguageTest extends AggregatorTestBase { + use CronRunTrait; + /** * Modules to install. * diff --git a/core/modules/aggregator/src/Tests/UpdateFeedItemTest.php b/core/modules/aggregator/tests/src/Functional/UpdateFeedItemTest.php similarity index 98% rename from core/modules/aggregator/src/Tests/UpdateFeedItemTest.php rename to core/modules/aggregator/tests/src/Functional/UpdateFeedItemTest.php index 67e96f17269cca612af6f495d8815bbb991dba1e..b850ca9ed8eb6769504ceaae00b4ea248206dcd1 100644 --- a/core/modules/aggregator/src/Tests/UpdateFeedItemTest.php +++ b/core/modules/aggregator/tests/src/Functional/UpdateFeedItemTest.php @@ -1,6 +1,6 @@ <?php -namespace Drupal\aggregator\Tests; +namespace Drupal\Tests\aggregator\Functional; use Drupal\aggregator\Entity\Feed; /** diff --git a/core/modules/aggregator/src/Tests/UpdateFeedTest.php b/core/modules/aggregator/tests/src/Functional/UpdateFeedTest.php similarity index 97% rename from core/modules/aggregator/src/Tests/UpdateFeedTest.php rename to core/modules/aggregator/tests/src/Functional/UpdateFeedTest.php index d2308744c2425d535eafec1ab2aa1bad8b54f335..a81e0aefd1f906d04b0373441a5eb0f2cd3dc066 100644 --- a/core/modules/aggregator/src/Tests/UpdateFeedTest.php +++ b/core/modules/aggregator/tests/src/Functional/UpdateFeedTest.php @@ -1,6 +1,6 @@ <?php -namespace Drupal\aggregator\Tests; +namespace Drupal\Tests\aggregator\Functional; /** * Update feed test.