Skip to content

Mock server doesn't run #8

@amirkhh

Description

@amirkhh

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions