/** * Test a good all match */ public function testFindMatchInResponseAllGood() { $response = new \stdClass(); $response->code = 200; $response->body = 'Hello world!'; $request = new Request(); $match = $request->findMatchInResponse($response, '/(Hello) (world)!/', true); $this->assertSame('world', $match[2]); }
/** * Test a good all match * * @return void */ public function testFindMatchInResponseAllGood() { $body = 'Hello world!'; $response = $this->mockResponse(200, $body); $request = new Request(); $match = $request->findMatchInResponse($response->getBody()->getContents(), '/(Hello) (world)!/', true); $this->assertSame('world', $match[2]); }