File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -62,4 +62,26 @@ public function testHasResponseFound(): void
6262
6363 $ this assertTrue ($ this cassette ->hasResponse ($ request'Expected true if request was found. ' );
6464 }
65+ 
66+  /** 
67+  * Test playback of a legacy cassette which does not have an index key. 
68+  */ 
69+  public  function  testPlaybackLegacyCassette (): void 
70+  {
71+  $ requestnew  Request ('GET ' , 'https://example.com ' );
72+  $ responsenew  Response (200 , [], 'sometest ' );
73+ 
74+  // Create recording array with no index key. 
75+  $ recording
76+  'request '  => $ requesttoArray (),
77+  'response '  => $ responsetoArray (),
78+  ];
79+ 
80+  $ storagenew  Storage \Yaml (vfsStream::url ('test/ ' ), 'json_test ' );
81+  $ storagestoreRecording ($ recording
82+  $ configurationnew  Configuration ();
83+  $ cassettenew  Cassette ('cassette_name ' , $ configuration$ storage
84+ 
85+  $ this assertEquals ($ responsetoArray (), $ cassetteplayback ($ requesttoArray ());
86+  }
6587}
                         You can’t perform that action at this time. 
           
                  
0 commit comments