Skip to content

Commit 1a94f5c

Browse files
committed
Adjust expectations to match any Symfony's EventDispatcher version
1 parent a00f807 commit 1a94f5c

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

tests/aik099/PHPUnit/BrowserConfiguration/ApiBrowserConfigurationTestCase.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,12 @@ public function testTestEndedWithoutSession($stopped_or_missing)
367367
$event->shouldReceive('getSession')->once();
368368
}
369369

370-
$event->shouldReceive('setDispatcher')->once(); // To remove with Symfony 3.0 release.
371-
$event->shouldReceive('setName')->once(); // To remove with Symfony 3.0 release.
370+
// Below methods were removed in Symfony 3.0.
371+
if ( \method_exists('\Symfony\Component\EventDispatcher\Event', 'setDispatcher') ) {
372+
$event->shouldReceive('setDispatcher')->once();
373+
$event->shouldReceive('setName')->once();
374+
}
375+
372376
$event->shouldReceive('isPropagationStopped')->once()->andReturn(false);
373377
$event->shouldReceive('getTestCase')->andReturn($test_case);
374378
$event->shouldReceive('validateSubscriber')->with($test_case)->atLeast()->once()->andReturn(true);
@@ -382,8 +386,8 @@ public function testTestEndedWithoutSession($stopped_or_missing)
382386
public function sessionStateDataProvider()
383387
{
384388
return array(
385-
array(true),
386-
array(false),
389+
'session stopped/missing' => array(true),
390+
'session started' => array(false),
387391
);
388392
}
389393

0 commit comments

Comments
 (0)