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

"Syntax error" during expectation creation when adding binary body to ResponseBuilder #30

Closed
amkoro opened this issue Dec 8, 2017 · 2 comments

Comments

@amkoro
Copy link

amkoro commented Dec 8, 2017

I found the issue during expectation creation when I tried to add a binary data from image:

$expectation = Phiremock::on(
    A::getRequest()
        ->andUrl(Is::equalTo('/test_images/image1.jpg'))
)->then(
    Respond::withStatusCode(200)
        ->andBody(file_get_contents($testDataPath.'test_images/image1.jpg'))
        ->andDelayInMillis(2000)
);

Package versions:

mcustiel/creature                        v2.0.0
mcustiel/mockable-datetime               1.0.0
mcustiel/phiremock                       v1.7.1
mcustiel/phiremock-codeception-extension dev-master e52996c
mcustiel/php-simple-di                   1.2.1
mcustiel/php-simple-request              v3.1.0
mcustiel/power-route                     v3.0.0

Error:

An error occurred creating the expectation: Syntax error
.../vendor/mcustiel/phiremock/src/Client/Phiremock.php:281
.../vendor/mcustiel/phiremock/src/Client/Phiremock.php:269
.../vendor/mcustiel/phiremock/src/Client/Phiremock.php:74
.../vendor/mcustiel/phiremock-codeception-extension/src/Module/Phiremock.php:59
@mcustiel
Copy link
Owner

Hi @amkoro
Thanks for reporting it, I will give it a look as soon as I have some time.

@mcustiel
Copy link
Owner

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

2 participants