Skip to content

Commit

Permalink
Updated readme usage example
Browse files Browse the repository at this point in the history
  • Loading branch information
cg-x committed Sep 20, 2024
1 parent 24a9f73 commit 3d489df
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Use `@vcr cassette_name` on your tests to turn VCR automatically on and off.
``` php

use PHPUnit\Framework\TestCase;
use VCR\PHPUnit\TestListener\Attributes\Vcr;

class VCRTest extends TestCase
{
Expand All @@ -30,6 +31,14 @@ class VCRTest extends TestCase
$result = file_get_contents('http://google.com');
$this->assertEquals('This is a annotation test dummy.', $result, 'Call was not intercepted (using annotations).');
}

#[Vcr('unittest_annotation_test')]
public function testInterceptsWithAttributes(): void
{
// Content of tests/fixtures/unittest_annotation_test: "This is a annotation test dummy".
$result = file_get_contents('http://google.com');
$this->assertEquals('This is a annotation test dummy.', $result, 'Call was not intercepted (using attributes).');
}
}
```

Expand Down

0 comments on commit 3d489df

Please sign in to comment.