public function EnsureSubscriberTest::testLoggingHappens in Flysystem 8
Same name and namespace in other branches
- 3.x tests/src/Unit/EventSubscriber/EnsureSubscriberTest.php \Drupal\Tests\flysystem\Unit\EventSubscriber\EnsureSubscriberTest::testLoggingHappens()
- 2.0.x tests/src/Unit/EventSubscriber/EnsureSubscriberTest.php \Drupal\Tests\flysystem\Unit\EventSubscriber\EnsureSubscriberTest::testLoggingHappens()
- 3.0.x tests/src/Unit/EventSubscriber/EnsureSubscriberTest.php \Drupal\Tests\flysystem\Unit\EventSubscriber\EnsureSubscriberTest::testLoggingHappens()
Tests that the event subscriber logs ensure() calls.
File
- tests/
src/ Unit/ EventSubscriber/ EnsureSubscriberTest.php, line 23
Class
- EnsureSubscriberTest
- @coversDefaultClass \Drupal\flysystem\EventSubscriber\EnsureSubscriber @covers \Drupal\flysystem\EventSubscriber\EnsureSubscriber
Namespace
Drupal\Tests\flysystem\Unit\EventSubscriberCode
public function testLoggingHappens() {
$logger = $this
->prophesize(LoggerInterface::class);
$dispatcher = $this
->getMock(EventDispatcherInterface::class);
$logger
->log('severity', 'message', array(
'context',
))
->shouldBeCalled();
$event = new EnsureEvent('scheme', 'severity', 'message', array(
'context',
));
$subscriber = new EnsureSubscriber($logger
->reveal());
$subscriber
->onEnsure($event, FlysystemEvents::ENSURE, $dispatcher);
}