8
8
use Chubbyphp \HttpException \HttpException ;
9
9
use Chubbyphp \Mock \MockMethod \WithCallback ;
10
10
use Chubbyphp \Mock \MockMethod \WithException ;
11
- use Chubbyphp \Mock \MockMethod \WithoutReturn ;
12
11
use Chubbyphp \Mock \MockMethod \WithReturn ;
13
12
use Chubbyphp \Mock \MockMethod \WithReturnSelf ;
14
13
use Chubbyphp \Mock \MockObjectBuilder ;
@@ -212,7 +211,7 @@ public function testProcessWithClientHttpExceptionWithoutLogger(): void
212
211
213
212
/** @var MockObject|StreamInterface $responseBody */
214
213
$ responseBody = $ builder ->create (StreamInterface::class, [
215
- new WithoutReturn ('write ' , [$ expectedBody ]),
214
+ new WithReturn ('write ' , [$ expectedBody ], \strlen ( $ expectedBody ) ),
216
215
]);
217
216
218
217
/** @var MockObject|ResponseInterface $response */
@@ -397,7 +396,7 @@ public function testProcessWithClientHttpExceptionWithLogger(): void
397
396
398
397
/** @var MockObject|StreamInterface $responseBody */
399
398
$ responseBody = $ builder ->create (StreamInterface::class, [
400
- new WithoutReturn ('write ' , [$ expectedBody ]),
399
+ new WithReturn ('write ' , [$ expectedBody ], \strlen ( $ expectedBody ) ),
401
400
]);
402
401
403
402
/** @var MockObject|ResponseInterface $response */
@@ -616,7 +615,7 @@ public function testProcessWithServerHttpExceptionWithDebugWithLogger(): void
616
615
617
616
/** @var MockObject|StreamInterface $responseBody */
618
617
$ responseBody = $ builder ->create (StreamInterface::class, [
619
- new WithoutReturn ('write ' , [$ expectedBody ]),
618
+ new WithReturn ('write ' , [$ expectedBody ], \strlen ( $ expectedBody ) ),
620
619
]);
621
620
622
621
/** @var MockObject|ResponseInterface $response */
@@ -688,7 +687,7 @@ public function testProcessWithExceptionWithDebugWithLogger(): void
688
687
689
688
/** @var MockObject|StreamInterface $responseBody */
690
689
$ responseBody = $ builder ->create (StreamInterface::class, [
691
- new WithCallback ('write ' , static function (string $ html ): void {
690
+ new WithCallback ('write ' , static function (string $ html ): int {
692
691
self ::assertStringContainsString (
693
692
'<p>A website error has occurred. Sorry for the temporary inconvenience.</p> ' ,
694
693
$ html
@@ -706,6 +705,8 @@ public function testProcessWithExceptionWithDebugWithLogger(): void
706
705
self ::assertStringContainsString ('<div class="md:col-span-7">logic exception</div> ' , $ html );
707
706
self ::assertStringContainsString ('<div><strong>Code</strong></div> ' , $ html );
708
707
self ::assertStringContainsString ('<div class="md:col-span-7">42</div> ' , $ html );
708
+
709
+ return \strlen ($ html );
709
710
}),
710
711
]);
711
712
0 commit comments