Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/VCRTestListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ public function startTest(Test $test): void
$parsed = self::parseDocBlock($docBlock, '@vcr');
$cassetteName = array_pop($parsed);

if (empty($cassetteName)) {
return;
}

// If the cassette name ends in .json, then use the JSON storage format
if (substr($cassetteName, -5) === '.json') {
VCR::configure()->setStorage('json');
}

if (empty($cassetteName)) {
return;
}

VCR::turnOn();
VCR::insertCassette($cassetteName);
}
Expand Down
8 changes: 8 additions & 0 deletions tests/VCRTestListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ public function testInterceptsWithAnnotationsWhenUsingDataProvider(int $dummyVal
$this->assertEquals('This is a annotation test dummy.', $result, 'Call was not intercepted (using annotations with data provider).');
}

/**
* @group https://github.com/php-vcr/phpunit-testlistener-vcr/issues/29
*/
public function testNoVcrAnnotationRunsSuccessfulAndDoesNotProduceWarnings()
{
$this->assertTrue(true, 'just adding an assertion here');
}

public function dummyDataProvider(): array
{
return [
Expand Down