File tree Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11<?php
22
33
4+ use Codeception \Configuration ;
45use Mcustiel \Phiremock \Client \Phiremock ;
56use Mcustiel \Phiremock \Client \Utils \A ;
67use 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}
You can’t perform that action at this time.
0 commit comments