You are here

public function PathautoPatternTest::testTweetPattern in Lightning Media 8.2

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

File

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

Class

PathautoPatternTest
@group lightning @group lightning_media

Namespace

Drupal\Tests\lightning_media\Functional

Code

public function testTweetPattern() {
  $media = Media::create([
    'id' => 1,
    'bundle' => 'tweet',
    'name' => 'Foo Bar',
    'status' => 1,
    'embed_code' => 'https://twitter.com/50NerdsofGrey/status/757319527151636480',
  ]);
  $media
    ->save();
  $this
    ->drupalGet("/media/tweet/{$media->id()}");
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->assertSession()
    ->pageTextContains('Foo Bar');
}