Skip to content

Commit c185c62

Browse files
committed
Fixes php-vcr#101.
1 parent dde2eff commit c185c62

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

src/VCR/Videorecorder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public function insertCassette($cassetteName)
176176

177177
$storage = $this->factory->get('Storage', array($cassetteName));
178178

179-
$this->cassette = new Cassette($cassetteName, $this->config, $storage, $this->getEventDispatcher());
179+
$this->cassette = new Cassette($cassetteName, $this->config, $storage);
180180
$this->enableLibraryHooks();
181181
}
182182

tests/VCR/VCRTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,12 @@ public function testShouldDispatchBeforeAfterHttpRequestAndBeforeRecordWhenCasse
158158
$this->doCurlGetRequest('http://google.com/');
159159

160160
$this->assertEquals(
161-
array(VCREvents::VCR_BEFORE_HTTP_REQUEST, VCREvents::VCR_AFTER_HTTP_REQUEST, VCREvents::VCR_BEFORE_RECORD),
161+
array(
162+
VCREvents::VCR_BEFORE_PLAYBACK,
163+
VCREvents::VCR_BEFORE_HTTP_REQUEST,
164+
VCREvents::VCR_AFTER_HTTP_REQUEST,
165+
VCREvents::VCR_BEFORE_RECORD
166+
),
162167
$this->getRecordedEventNames()
163168
);
164169
VCR::eject();

tests/VCR/VideorecorderTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,13 @@ protected function getCassetteMock($request, $response, $mode = VCR::MODE_NEW_EP
147147
{
148148
$cassette = $this->getMockBuilder('\VCR\Cassette')
149149
->disableOriginalConstructor()
150-
->setMethods(array('hasResponse', 'record', 'playback', 'isNew'))
150+
->setMethods(array('record', 'playback', 'isNew'))
151151
->getMock();
152152
$cassette
153153
->expects($this->once())
154-
->method('hasResponse')
154+
->method('playback')
155155
->with($request)
156-
->will($this->returnValue(false));
156+
->will($this->returnValue(null));
157157

158158
if (VCR::MODE_NEW_EPISODES === $mode || VCR::MODE_ONCE === $mode && $isNew === true) {
159159
$cassette

0 commit comments

Comments
 (0)