Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation: Best way to assert "static" pages (like e.g. robots.txt) #5973

Closed
ThomasLandauer opened this issue Sep 13, 2020 · 1 comment
Closed

Comments

@ThomasLandauer
Copy link
Member

What's the best way to assert "static" pages/assets - stuff like robots.txt or favicon.ico or sitemap.xml?

I'm doing it this way in an acceptance test with REST module enabled:

public function tryRobotsTxt(AcceptanceTester $I)
{
    $I->sendGET('/robots.txt');
    $I->seeResponseCodeIs(200);
    $I->seeHttpHeader('Content-Type', 'text/plain');
    $I->seeResponseContains('http://www.robotstxt.org/');
    $I->seeResponseContains('Sitemap:');
    $I->seeResponseContains('User-agent: *');
}

Rationale: Since we're talking to robots/spiders, meta data like response code or HTTP headers might be more important than on "regular" pages?

@Naktibalda
Copy link
Member

I don't see anything special about testing responses of static files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants