You are here

public function PathautoPatternTest::testInstagramPattern in Lightning Media 8.2

Tests that instagram media entities are available at path '/media/instagram/[media:mid]'.

File

tests/src/Functional/PathautoPatternTest.php, line 87

Class

PathautoPatternTest
@group lightning @group lightning_media

Namespace

Drupal\Tests\lightning_media\Functional

Code

public function testInstagramPattern() {
  $media = Media::create([
    'id' => 1,
    'bundle' => 'instagram',
    'name' => 'Foo Bar',
    'status' => 1,
    'embed_code' => 'https://www.instagram.com/p/BmIh_AFDBzX',
  ]);
  $media
    ->save();
  $this
    ->drupalGet("/media/instagram/{$media->id()}");
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->assertSession()
    ->pageTextContains('Foo Bar');
}