diff --git a/.github/workflows/test.yml b/.github/workflows/run.yml similarity index 95% rename from .github/workflows/test.yml rename to .github/workflows/run.yml index bf0e475..a1f2b2d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/run.yml @@ -21,8 +21,8 @@ jobs: strategy: matrix: - DRUPAL_TESTING_DRUPAL_VERSION: ['~8.9.0', '~9.2.0'] - PHP: ['7.4'] + DRUPAL_TESTING_DRUPAL_VERSION: ['~9.2.0'] + PHP: ['7.4', '8.0'] steps: - uses: actions/checkout@v1 diff --git a/src/Controller/RssController.php b/src/Controller/RssController.php index c387ac2..f946c4a 100644 --- a/src/Controller/RssController.php +++ b/src/Controller/RssController.php @@ -179,7 +179,7 @@ public function buildItems() { 'pubDate' => $this->dateFormatter->format($item->getChangedTime(), 'custom', 'r'), 'author' => $item->field_author->first()->view(), /* @phpstan-ignore-line */ 'content:encoded' => $item->field_content->first()->view(), /* @phpstan-ignore-line */ - 'amzn:heroImage' => ($hero_image = $item->field_hero_image->entity) ? $hero_image->url() : NULL, + 'amzn:heroImage' => ($hero_image = $item->field_hero_image->entity) ? $hero_image->createFileUrl(FALSE) : NULL, 'amzn:heroImageCaption' => ($hero_image_caption = $item->field_hero_image_caption->first()) ? $hero_image_caption->view() : NULL, /* @phpstan-ignore-line */ 'amzn:introText' => $item->field_intro_text->first()->view(), /* @phpstan-ignore-line */ 'amzn:indexContent' => $item->field_index_content->first()->view(), /* @phpstan-ignore-line */ diff --git a/tests/fixtures/feed.rss b/tests/fixtures/feed.rss index 7fc96ef..a61efaa 100644 --- a/tests/fixtures/feed.rss +++ b/tests/fixtures/feed.rss @@ -7,7 +7,7 @@ Wed, 19 Aug 2020 10:00:00 +1000 1.0 Bacon ipsumhttp://example.com/baconWed, 19 Aug 2020 10:00:00 +1000Bernd am GrillBacon ipsum dolor amet chuck tenderloin sirloin, chicken tail kevin doner meatball jerky landjaeger jowl alcatra.

-]]>
Falsehttps://amazon.de/dp/asdfghjklk1Award
+]]>http://example.com/test-image.jpgFalsehttps://amazon.de/dp/asdfghjklk1Award Bavaria ipsum dolor sit amet Prosd dei Marterl.http://example.com/bavariaWed, 19 Aug 2020 10:00:00 +1000FonsiBavaria ipsum dolor sit amet Prosd dei Marterl. Diandldrahn boarischer wea ko, dea ko Blosmusi Watschnpladdla no gwiss. Wiavui i auszutzeln Zidern, es!

]]>
Falsehttps://amazon.de/dp/asdfghjklk1Award
diff --git a/tests/src/Functional/OnSiteTest.php b/tests/src/Functional/OnSiteTest.php index 306c787..f0e2688 100644 --- a/tests/src/Functional/OnSiteTest.php +++ b/tests/src/Functional/OnSiteTest.php @@ -4,6 +4,7 @@ use Drupal\amazon_onsite\Entity\AopFeedItem; use Drupal\Core\Url; +use Drupal\file\Entity\File; use Drupal\Tests\BrowserTestBase; /** @@ -55,12 +56,18 @@ public function testFeed() { $this->drupalLogin($this->anonymousUser); + $file = File::create([ + 'uri' => 'http://example.com/test-image.jpg', + ]); + $file->save(); + AopFeedItem::create([ 'title' => 'Bacon ipsum', 'field_url' => 'http://example.com/bacon', 'field_author' => 'Bernd am Grill', 'field_content' => 'Bacon ipsum dolor amet chuck tenderloin sirloin, chicken tail kevin doner meatball jerky landjaeger jowl alcatra.', 'field_intro_text' => 'Capicola biltong leberkas hamburger.', + 'field_hero_image' => $file->id(), 'changed' => \DateTime::createFromFormat('Y-m-d H:i:s', '2020-08-19 10:00:00')->getTimestamp(), 'field_products' => [ [