public function testTrackToArrayWithRequestAndResponseAndException() { $array = $this->converter->trackToArray($track = $this->createTrack($this->createRequest(), $this->createResponse(), $this->createException())); $this->assertArrayHasKey('request', $array); $this->assertArrayHasKey('response', $array); $this->assertArrayHasKey('exception', $array); $check = $this->converter->arrayToTrack($array); $this->assertTrue($check->hasResponse()); $this->assertTrue($check->hasException()); }
public function load() { $this->tracks = []; $filePath = $this->getFilePath(); if (is_file($filePath) && is_readable($filePath)) { $data = Yaml::parse(file_get_contents($filePath)); foreach ($data as $item) { $this->writeTrack($this->converter->arrayToTrack($item)); } } }