File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -119,14 +119,21 @@ public function startTest(PHPUnit_Framework_Test $test)
119
119
$ doc_block = $ reflection ->getDocComment ();
120
120
121
121
// Use regex to parse the doc_block for a specific annotation
122
- $ cassetteName = self ::parseDocBlock ($ doc_block , '@vcr ' );
122
+ $ cassetteName = array_pop (self ::parseDocBlock ($ doc_block , '@vcr ' ));
123
+
124
+ // If the cassette name ends in .json, then use the JSON storage format
125
+ if (substr ($ cassetteName , '-5 ' ) == '.json ' ) {
126
+ \VCR \VCR ::configure ()->setStorage ('json ' );
127
+ } else {
128
+ \VCR \VCR ::configure ()->setStorage ('yaml ' );
129
+ }
123
130
124
131
if (empty ($ cassetteName )) {
125
132
return true ;
126
133
}
127
134
128
135
\VCR \VCR ::turnOn ();
129
- \VCR \VCR ::insertCassette (array_pop ( $ cassetteName) );
136
+ \VCR \VCR ::insertCassette ($ cassetteName );
130
137
}
131
138
132
139
private static function parseDocBlock ($ doc_block , $ tag )
You can’t perform that action at this time.
0 commit comments