container = $this->makeEmpty(ContainerInterface::class, [ 'has' => true, 'get' => new PDO( 'pgsql:host=psql.torsten-hettstedt.net;port=5432;dbname=testdb;user=bruce;password=mypass' ), ]); $this->response = $this->createMock(Response::class); $this->response->expects($this->any())->method('getStatusCode')->willReturn(self::FICTIONAL_STATUS_CODE); $this->response->expects($this->any())->method('getBody')->willReturn( $this->makeEmpty(StreamInterface::class, [ 'write' => function (mixed $data) { $this->assertIsString($data); $this->assertJson($data); return strlen($data); }, 'getContents' => 'abc', ]) ); $this->response->expects($this->any())->method('withHeader')->willReturn($this->response); $this->response->expects($this->any())->method('withStatus')->willReturn($this->response); } }