You are here

public function AdsTxtTest::testAdsTxtPath in AdsTxt 8

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

File

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

Class

AdsTxtTest
Tests functionality of configured ads.txt files.

Namespace

Drupal\Tests\adstxt\Functional

Code

public function testAdsTxtPath() {
  $this
    ->drupalGet('ads.txt');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->assertText('greenadexchange.com, 12345, DIRECT, AEC242');
  $this
    ->assertText('blueadexchange.com, 4536, DIRECT');
  $this
    ->assertText('silverssp.com, 9675, RESELLER');
  $this
    ->assertSession()
    ->responseHeaderEquals('Content-Type', 'text/plain; charset=UTF-8');
}