Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setCassettePath not working in phpunit setUp method #291

Open
foremtehan opened this issue Dec 7, 2019 · 0 comments
Open

setCassettePath not working in phpunit setUp method #291

foremtehan opened this issue Dec 7, 2019 · 0 comments

Comments

@foremtehan
Copy link

foremtehan commented Dec 7, 2019

class DiscogsApiTest extends TestCase
{
    protected function setUp(): void
    {
        parent::setUp();

        \VCR\VCR::configure()->setCassettePath('tests/Unit/myfolder');

        $client = new Client();

        $response = $client->get('https://api.github.com/');

        $this->json = json_decode($response->getBody(), true);
    }

    /**
     * @test
     * @vcr github
     */
    public function test_api()
    {
        dd($this->json);
    }

}

Is it possible to use setCassettePath on phpunit setUp method? i hate using it on bootsrap.php file because for every test i should execute that method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant