From f4f659c95a8861feb528d3d4342bffe0ce58daa5 Mon Sep 17 00:00:00 2001 From: Andrey Savchenko Date: Fri, 21 Feb 2020 17:18:47 +0200 Subject: [PATCH] Changed bootable interface to inherit so mock can work on PHPUnit 9. --- CHANGELOG.md | 3 +++ src/Provider/Bootable_Provider_Interface.php | 3 ++- tests/PluginTest.php | 3 +-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 743a00f..0f8de34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## Unreleased +### Changed +- `Bootable_Provider_Interface` to extend `ServiceProviderInterface`, so that it can be mocked in PHPUnit 9 + ### Fixed - Mustache.php version to resolve issues on PHP 7.4 diff --git a/src/Provider/Bootable_Provider_Interface.php b/src/Provider/Bootable_Provider_Interface.php index 22b419b..d60b330 100644 --- a/src/Provider/Bootable_Provider_Interface.php +++ b/src/Provider/Bootable_Provider_Interface.php @@ -3,12 +3,13 @@ declare( strict_types=1 ); namespace Rarst\Laps\Provider; +use Pimple\ServiceProviderInterface; use Rarst\Laps\Plugin; /** * Interface for providers that need to boot up once plugin is ready to start. */ -interface Bootable_Provider_Interface { +interface Bootable_Provider_Interface extends ServiceProviderInterface { /** * @param Plugin $laps Container instance. diff --git a/tests/PluginTest.php b/tests/PluginTest.php index 4b79bd5..e0c816e 100644 --- a/tests/PluginTest.php +++ b/tests/PluginTest.php @@ -3,7 +3,6 @@ namespace Rarst\Laps\Tests; use Brain\Monkey\Functions; -use Pimple\ServiceProviderInterface; use Rarst\Laps\Provider\Bootable_Provider_Interface; class PluginTest extends LapsTestCase { @@ -12,7 +11,7 @@ class PluginTest extends LapsTestCase { $container = new \Rarst\Laps\Plugin(); - $service = $this->getMockBuilder( [ ServiceProviderInterface::class, Bootable_Provider_Interface::class ] ) + $service = $this->getMockBuilder( Bootable_Provider_Interface::class ) ->getMock(); $service->expects( $this->once() )