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

Added availability check functions #33

Merged
merged 1 commit into from Nov 16, 2020
Merged

Added availability check functions #33

merged 1 commit into from Nov 16, 2020

Conversation

TavoNiievez
Copy link
Member

$I->seePageIsAvailable() allows to do in a line of code what is normally done like this: [See source]

    public function testPublicBlogPost(): void
    {
        $client = static::createClient();
        $blogPost = $client->getContainer()->get('doctrine')->getRepository(Post::class)->find(1);
        $client->request('GET', sprintf('/en/blog/posts/%s', $blogPost->getSlug()));

        $this->assertResponseIsSuccessful();
    }

while $I->seePageRedirectsTo() allows to do in a line of code what is normally done in this way: [See source]

    public function testSecureUrls(string $url): void
    {
        $client = static::createClient();
        $client->request('GET', $url);

        $this->assertResponseRedirects(
            'http://localhost/en/login',
            Response::HTTP_FOUND,
            sprintf('The %s secure URL redirects to the login form.', $url)
        );
    }

*
* @param string $url
*/
public function seePageIsAvailable($url)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can take this into InnerBrowser so it would be available to all frameworks and php browser?
This doesn't seem to be Symfony related

@TavoNiievez TavoNiievez merged commit a51056b into Codeception:master Nov 16, 2020
@TavoNiievez TavoNiievez deleted the checkAvailability branch November 16, 2020 15:57
@TavoNiievez TavoNiievez added this to the 1.3.0 milestone Nov 21, 2020
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

Successfully merging this pull request may close these issues.

None yet

2 participants