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

php-vcr not replaying cassette instead firing multiple requests #251

Open
sithara opened this issue Jun 12, 2018 · 0 comments
Open

php-vcr not replaying cassette instead firing multiple requests #251

sithara opened this issue Jun 12, 2018 · 0 comments

Comments

@sithara
Copy link

sithara commented Jun 12, 2018

My tests configured with php-vcr records requests to vcr-cassette but does not replay the cassette . Instead it fires the http request over and over again

public function testInvalidOrderUpload() {
        $filename = 'my_file.pdf';
        $filepath = APPPATH.'tests/fixtures/'.$filename;
        $files = [
            'order' => [
                'name'     => $filename,
                'type'     => 'pdf',
                'tmp_name' => $filepath,
            ],
        ];

        $this->request->setFiles($files);
        \VCR\VCR::insertCassette('example');
        $output = $this->request('POST', 'orders/upload');
         $this->assertNotEmpty($output);
        \VCR\VCR::eject();
    }

and this is my Bootstrap.php

\VCR\VCR::turnOn();
\VCR\VCR::configure()->setCassettePath(APPPATH.'tests/vcr');

The external server is hit within the orders#upload action. The requests get captured correctly in the vcr cassette but instead of replaying the request the next time, it saves another new request to the cassette.

Appreciate any help

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