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

Mock server doesn't run #8

Open
amirkhh opened this issue May 23, 2019 · 0 comments
Open

Mock server doesn't run #8

amirkhh opened this issue May 23, 2019 · 0 comments

Comments

@amirkhh
Copy link

amirkhh commented May 23, 2019

Hi, I have a problem with this package when I use it and I can not run mock server.

When I run my test, test stopped and print this message:

Starting http mock server on http-mock:28080

This is my config in codeption.yml:

extensions:
    enabled:
        - Codeception\Extension\HttpMock
        - Codeception\Extension\RunFailed
    config:
        Codeception\Extension\HttpMock:
            port: 28080 # defaults to http-mock default port
            host: http-mock # defaults to http-mock default host
modules:
   enabled:
      - HttpMock

and my test is:

    public function mock(ApiTester $I)
    {
        $I->expectRequest()->when()
            ->methodIs('GET')
            ->pathIs('/xyz')
            ->then()
            ->body('1234')
            ->end();
        $I->doNotExpectAnyOtherRequest();
        $response = file_get_contents('http://http-mock:28080/xyz');
        $I->assertEquals('1234', $response);
    }

Where is wrong ? thank you.

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

1 participant