@@ -190,8 +190,13 @@ public function test_respond_method_sends_response_to_swoole(): void
190190        $ swooleResponse ->shouldReceive ('header ' )->once ()->with ('Cache-Control ' , 'no-cache, private ' , true );
191191        $ swooleResponse ->shouldReceive ('header ' )->once ()->with ('Content-Type ' , 'text/html ' , true );
192192        $ swooleResponse ->shouldReceive ('header ' )->once ()->with ('Date ' , Mockery::type ('string ' ), true );
193-         $ swooleResponse ->shouldReceive ('cookie ' )->once ()->with ('new ' , 'value ' , 0 , '/ ' , '' , false , true , 'lax ' );
194-         $ swooleResponse ->shouldReceive ('cookie ' )->once ()->with ('cleared ' , 'deleted ' , Mockery::type ('int ' ), '/ ' , '' , false , true , 'lax ' );
193+         if  (extension_loaded ('swoole ' ) && SWOOLE_VERSION_ID  >= 60000 ) {
194+             $ swooleResponse ->shouldReceive ('cookie ' )->once ()->with ('new ' , 'value ' , 0 , '/ ' , '' , false , true , 'lax ' , '' , false );
195+             $ swooleResponse ->shouldReceive ('cookie ' )->once ()->with ('cleared ' , 'deleted ' , Mockery::type ('int ' ), '/ ' , '' , false , true , 'lax ' , '' , false );
196+         } else  {
197+             $ swooleResponse ->shouldReceive ('cookie ' )->once ()->with ('new ' , 'value ' , 0 , '/ ' , '' , false , true , 'lax ' );
198+             $ swooleResponse ->shouldReceive ('cookie ' )->once ()->with ('cleared ' , 'deleted ' , Mockery::type ('int ' ), '/ ' , '' , false , true , 'lax ' );
199+         }
195200        $ swooleResponse ->shouldReceive ('write ' )->with ('Hello World ' );
196201        $ swooleResponse ->shouldReceive ('end ' )->once ();
197202
0 commit comments