/** * @dataProvider getFixtures */ public function testReplayReplication($fixtureFile) { $filter = $this->getRequestFilter(); $messageHandler = new MessageHandler\Symfony2(); $dumps = $this->getRequests($fixtureFile); $replicator = $this->getReplicator(); foreach ($dumps as $nr => $dump) { $request = $dump->request; $expectedResponse = $dump->response; $endpoint = new Endpoint\Symfony($replicator, "master"); $actualResponse = $endpoint->runRequest($request); $this->assertEquals($filter->filterResponse($messageHandler->simplifyResponse($request, $expectedResponse)), $filter->filterResponse($messageHandler->simplifyResponse($request, $actualResponse)), "Failed to respond to #{$nr}: {$request}"); } }
/** * @expectedException UnexpectedValueException */ public function testFailSimplifyInvalidResponse() { $messageHandler = new Symfony2(); $messageHandler->simplifyResponse(Request::create('/'), new \StdClass()); }