getTapeContent() public method

Returns the content of a specific tape without writing it to disk.
public getTapeContent ( string $name ) : null | string
$name string
return null | string
コード例 #1
0
 public function testPlayerCanReplayFromContent()
 {
     $mock = SimpleMockHandler::create()->withMultipleResponses(5, 200)->withMultipleResponses(5, 403)->withMultipleResponses(5, 404)->build();
     $client = SimpleMockedClient::createMockedClient($mock, $this->recorder);
     for ($i = 0; $i < 15; $i++) {
         try {
             $client->get('/');
         } catch (RequestException $e) {
         }
     }
     $content = $this->recorder->getTapeContent('tape-all');
     $player = Player::replayFromContent($content);
     $this->assertInstanceOf('GuzzleHttp\\Client', $player->getClient());
     $this->assertEquals(200, $player->get('/')->getStatusCode());
 }