Ikwattro\GuzzleStereo\Recorder::getTape PHP Метод

getTape() публичный Метод

public getTape ( string $name ) : Ikwattro\GuzzleStereo\Record\Tape
$name string
Результат Ikwattro\GuzzleStereo\Record\Tape
    public function getTape($name)
    {
        if (!array_key_exists($name, $this->tapes)) {
            throw new RecorderException(sprintf('There is no tape with name "%s" registered', $name));
        }
        return $this->tapes[$name];
    }

Usage Example

 public function testHasHeaderFilterIsRecordingResponsesWithCorrespondingFilterAndOthers()
 {
     $mock = SimpleMockHandler::create()->withMultipleResponses(5, 200, ['Content-Type' => 'application/json', 'Accept' => 'application/json'], json_encode(array('id' => 1)))->build();
     $client = SimpleMockedClient::createMockedClient($mock, $this->recorder);
     for ($i = 0; $i < 5; $i++) {
         try {
             $client->get('/');
         } catch (RequestException $e) {
         }
     }
     $this->assertCount(5, $this->recorder->getTape('filter-has-header')->getResponses());
 }
All Usage Examples Of Ikwattro\GuzzleStereo\Recorder::getTape