Skip to content

Commit 266c396

Browse files
committed
Added test for big contents in response
1 parent 8589023 commit 266c396

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

tests/tests/_data/dump.sql

Lines changed: 0 additions & 1 deletion
This file was deleted.
1.31 MB
Binary file not shown.

tests/tests/acceptance/BasicTestCest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22

33

4+
use Codeception\Configuration;
45
use Mcustiel\Phiremock\Client\Phiremock;
56
use Mcustiel\Phiremock\Client\Utils\A;
67
use Mcustiel\Phiremock\Client\Utils\Is;
@@ -76,4 +77,19 @@ public function severalExceptatationsInOneTest(AcceptanceTester $I)
7677
$I->didNotReceiveRequestsInRemoteService();
7778
$I->seeRemoteServiceReceived(0, A::getRequest());
7879
}
80+
81+
public function shouldCreateAnExpectationWithBinaryResponseTest(AcceptanceTester $I)
82+
{
83+
$responseContents = file_get_contents(Configuration::dataDir() . '/fixtures/Sparkles-12543.mp4');
84+
$I->expectARequestToRemoteServiceWithAResponse(
85+
Phiremock::on(
86+
A::getRequest()->andUrl(Is::equalTo('/show-me-the-video'))
87+
)->then(
88+
Respond::withStatusCode(200)->andBinaryBody($responseContents)
89+
)
90+
);
91+
92+
$responseBody = file_get_contents('http://localhost:18080/show-me-the-video');
93+
$I->assertEquals($responseContents, $responseBody);
94+
}
7995
}

0 commit comments

Comments
 (0)