File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed
Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ public function handleErrorEvent($e)
3131 public function write ($ data )
3232 {
3333 $ this ->buffer .= $ data ;
34+ $ this ->deferred ->progress ($ data );
3435 }
3536
3637 public function close ()
Original file line number Diff line number Diff line change @@ -107,19 +107,30 @@ public function errorsShouldRejectPromise()
107107 }
108108
109109 /** @test */
110- public function writeShouldNotTriggerProgressOnPromise ()
110+ public function writeShouldTriggerProgressOnPromise ()
111111 {
112112 $ callback = $ this ->createCallableMock ();
113113 $ callback
114- ->expects ($ this ->never ())
115- ->method ('__invoke ' );
114+ ->expects ($ this ->at (0 ))
115+ ->method ('__invoke ' )
116+ ->with ('foo ' );
117+ $ callback
118+ ->expects ($ this ->at (1 ))
119+ ->method ('__invoke ' )
120+ ->with ('bar ' );
121+ $ callback
122+ ->expects ($ this ->at (2 ))
123+ ->method ('__invoke ' )
124+ ->with ('baz ' );
116125
117126 $ sink = new BufferedSink ();
118127 $ sink
119128 ->promise ()
120129 ->then (null , null , $ callback );
121130
122131 $ sink ->write ('foo ' );
132+ $ sink ->write ('bar ' );
133+ $ sink ->end ('baz ' );
123134 }
124135
125136 /** @test */
You can’t perform that action at this time.
0 commit comments