You are here

public function AdsTxtTest::testAppAdsTxtPath in AdsTxt 8

Test that the ads.txt path delivers content with an appropriate header.

File

tests/src/Functional/AdsTxtTest.php, line 69

Class

AdsTxtTest
Tests functionality of configured ads.txt files.

Namespace

Drupal\Tests\adstxt\Functional

Code

public function testAppAdsTxtPath() {
  $this
    ->drupalGet('app-ads.txt');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->assertText('onetwothree.com, 12345, DIRECT, AEC242');
  $this
    ->assertText('fourfivesix.com, 4536, DIRECT');
  $this
    ->assertText('97whatever.com, 9675, RESELLER');
  $this
    ->assertSession()
    ->responseHeaderEquals('Content-Type', 'text/plain; charset=UTF-8');
}