예제 #1
0
 /**
  * @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}");
     }
 }
예제 #2
0
 /**
  * @expectedException UnexpectedValueException
  */
 public function testFailSimplifyInvalidResponse()
 {
     $messageHandler = new Symfony2();
     $messageHandler->simplifyResponse(Request::create('/'), new \StdClass());
 }