diff --git a/src/Symfony/Bridge/Doctrine/Tests/Security/User/EntityUserProviderTest.php b/src/Symfony/Bridge/Doctrine/Tests/Security/User/EntityUserProviderTest.php index cb809abbaf..257c6f7a93 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Security/User/EntityUserProviderTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Security/User/EntityUserProviderTest.php @@ -70,7 +70,7 @@ class EntityUserProviderTest extends TestCase { $user = new User(1, 1, 'user1'); - $repository = $this->createMock([ObjectRepository::class, UserLoaderInterface::class]); + $repository = $this->createMock(UserLoaderRepository::class); $repository ->expects($this->once()) ->method('loadUserByUsername') @@ -156,7 +156,7 @@ class EntityUserProviderTest extends TestCase public function testLoadUserByUserNameShouldLoadUserWhenProperInterfaceProvided() { - $repository = $this->createMock([ObjectRepository::class, UserLoaderInterface::class]); + $repository = $this->createMock(UserLoaderRepository::class); $repository->expects($this->once()) ->method('loadUserByUsername') ->with('name') @@ -189,7 +189,7 @@ class EntityUserProviderTest extends TestCase { $user = new User(1, 1, 'user1'); - $repository = $this->createMock([interface_exists(ObjectRepository::class) ? ObjectRepository::class : LegacyObjectRepository::class, PasswordUpgraderInterface::class]); + $repository = $this->createMock(PasswordUpgraderRepository::class); $repository->expects($this->once()) ->method('upgradePassword') ->with($user, 'foobar'); @@ -233,3 +233,11 @@ class EntityUserProviderTest extends TestCase ]); } } + +abstract class UserLoaderRepository implements ObjectRepository, UserLoaderInterface +{ +} + +abstract class PasswordUpgraderRepository implements ObjectRepository, PasswordUpgraderInterface +{ +} diff --git a/src/Symfony/Component/Cache/Tests/Adapter/ChainAdapterTest.php b/src/Symfony/Component/Cache/Tests/Adapter/ChainAdapterTest.php index 3e723f1b6a..53295a1eef 100644 --- a/src/Symfony/Component/Cache/Tests/Adapter/ChainAdapterTest.php +++ b/src/Symfony/Component/Cache/Tests/Adapter/ChainAdapterTest.php @@ -16,8 +16,8 @@ use Symfony\Component\Cache\Adapter\AdapterInterface; use Symfony\Component\Cache\Adapter\ArrayAdapter; use Symfony\Component\Cache\Adapter\ChainAdapter; use Symfony\Component\Cache\Adapter\FilesystemAdapter; -use Symfony\Component\Cache\PruneableInterface; use Symfony\Component\Cache\Tests\Fixtures\ExternalAdapter; +use Symfony\Component\Cache\Tests\Fixtures\PrunableAdapter; /** * @author Kévin Dunglas @@ -189,7 +189,7 @@ class ChainAdapterTest extends AdapterTestCase private function getPruneableMock(): AdapterInterface { - $pruneable = $this->createMock([PruneableInterface::class, AdapterInterface::class]); + $pruneable = $this->createMock(PrunableAdapter::class); $pruneable ->expects($this->atLeastOnce()) @@ -201,7 +201,7 @@ class ChainAdapterTest extends AdapterTestCase private function getFailingPruneableMock(): AdapterInterface { - $pruneable = $this->createMock([PruneableInterface::class, AdapterInterface::class]); + $pruneable = $this->createMock(PrunableAdapter::class); $pruneable ->expects($this->atLeastOnce()) diff --git a/src/Symfony/Component/Cache/Tests/Adapter/TagAwareAdapterTest.php b/src/Symfony/Component/Cache/Tests/Adapter/TagAwareAdapterTest.php index e0111c1d6c..4d60f4cbd4 100644 --- a/src/Symfony/Component/Cache/Tests/Adapter/TagAwareAdapterTest.php +++ b/src/Symfony/Component/Cache/Tests/Adapter/TagAwareAdapterTest.php @@ -18,7 +18,7 @@ use Symfony\Component\Cache\Adapter\AdapterInterface; use Symfony\Component\Cache\Adapter\ArrayAdapter; use Symfony\Component\Cache\Adapter\FilesystemAdapter; use Symfony\Component\Cache\Adapter\TagAwareAdapter; -use Symfony\Component\Cache\PruneableInterface; +use Symfony\Component\Cache\Tests\Fixtures\PrunableAdapter; use Symfony\Component\Cache\Tests\Traits\TagAwareTestTrait; /** @@ -204,7 +204,7 @@ class TagAwareAdapterTest extends AdapterTestCase */ private function getPruneableMock(): AdapterInterface { - $pruneable = $this->createMock([PruneableInterface::class, AdapterInterface::class]); + $pruneable = $this->createMock(PrunableAdapter::class); $pruneable ->expects($this->atLeastOnce()) @@ -216,7 +216,7 @@ class TagAwareAdapterTest extends AdapterTestCase private function getFailingPruneableMock(): AdapterInterface { - $pruneable = $this->createMock([PruneableInterface::class, AdapterInterface::class]); + $pruneable = $this->createMock(PrunableAdapter::class); $pruneable ->expects($this->atLeastOnce()) diff --git a/src/Symfony/Component/Cache/Tests/Fixtures/PrunableAdapter.php b/src/Symfony/Component/Cache/Tests/Fixtures/PrunableAdapter.php new file mode 100644 index 0000000000..9668ed595f --- /dev/null +++ b/src/Symfony/Component/Cache/Tests/Fixtures/PrunableAdapter.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Cache\Tests\Fixtures; + +use Symfony\Component\Cache\Adapter\AdapterInterface; +use Symfony\Component\Cache\PruneableInterface; + +abstract class PrunableAdapter implements AdapterInterface, PruneableInterface +{ +} diff --git a/src/Symfony/Component/Cache/Tests/Fixtures/PrunableCache.php b/src/Symfony/Component/Cache/Tests/Fixtures/PrunableCache.php new file mode 100644 index 0000000000..c1b3f74012 --- /dev/null +++ b/src/Symfony/Component/Cache/Tests/Fixtures/PrunableCache.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Cache\Tests\Fixtures; + +use Psr\SimpleCache\CacheInterface; +use Symfony\Component\Cache\PruneableInterface; + +abstract class PrunableCache implements CacheInterface, PruneableInterface +{ +} diff --git a/src/Symfony/Component/Cache/Tests/Simple/ChainCacheTest.php b/src/Symfony/Component/Cache/Tests/Simple/ChainCacheTest.php index 9198c8f46a..47e6b8686a 100644 --- a/src/Symfony/Component/Cache/Tests/Simple/ChainCacheTest.php +++ b/src/Symfony/Component/Cache/Tests/Simple/ChainCacheTest.php @@ -12,10 +12,10 @@ namespace Symfony\Component\Cache\Tests\Simple; use Psr\SimpleCache\CacheInterface; -use Symfony\Component\Cache\PruneableInterface; use Symfony\Component\Cache\Simple\ArrayCache; use Symfony\Component\Cache\Simple\ChainCache; use Symfony\Component\Cache\Simple\FilesystemCache; +use Symfony\Component\Cache\Tests\Fixtures\PrunableCache; /** * @group time-sensitive @@ -65,7 +65,7 @@ class ChainCacheTest extends CacheTestCase private function getPruneableMock(): CacheInterface { - $pruneable = $this->createMock([CacheInterface::class, PruneableInterface::class]); + $pruneable = $this->createMock(PrunableCache::class); $pruneable ->expects($this->atLeastOnce()) @@ -77,7 +77,7 @@ class ChainCacheTest extends CacheTestCase private function getFailingPruneableMock(): CacheInterface { - $pruneable = $this->createMock([CacheInterface::class, PruneableInterface::class]); + $pruneable = $this->createMock(PrunableCache::class); $pruneable ->expects($this->atLeastOnce())