From 17ca023be5bf83e24be89d8e97652c7560701b2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edi=20Modri=C4=87?= Date: Mon, 5 Jun 2023 09:50:09 +0200 Subject: [PATCH] Remove usage of self::any --- tests/bundle/DependencyInjection/ConfigurationTest.php | 1 - tests/lib/Item/ValueLoader/ContentValueLoaderTest.php | 8 -------- tests/lib/Item/ValueLoader/LocationValueLoaderTest.php | 6 ------ .../ValueObjectProvider/ContentProviderTest.php | 4 ---- .../ValueObjectProvider/LocationProviderTest.php | 3 --- 5 files changed, 22 deletions(-) diff --git a/tests/bundle/DependencyInjection/ConfigurationTest.php b/tests/bundle/DependencyInjection/ConfigurationTest.php index d2de087..f5869ae 100644 --- a/tests/bundle/DependencyInjection/ConfigurationTest.php +++ b/tests/bundle/DependencyInjection/ConfigurationTest.php @@ -101,7 +101,6 @@ protected function getConfiguration(): ConfigurationInterface { $extensionMock = $this->createMock(ExtensionInterface::class); $extensionMock - ->expects(self::any()) ->method('getAlias') ->willReturn('alias'); diff --git a/tests/lib/Item/ValueLoader/ContentValueLoaderTest.php b/tests/lib/Item/ValueLoader/ContentValueLoaderTest.php index 0a469ff..4156420 100644 --- a/tests/lib/Item/ValueLoader/ContentValueLoaderTest.php +++ b/tests/lib/Item/ValueLoader/ContentValueLoaderTest.php @@ -46,7 +46,6 @@ public function testLoad(): void ); $this->loadServiceMock - ->expects(self::any()) ->method('loadContent') ->with(self::identicalTo(52)) ->willReturn($content); @@ -60,7 +59,6 @@ public function testLoad(): void public function testLoadWithNoContent(): void { $this->loadServiceMock - ->expects(self::any()) ->method('loadContent') ->with(self::identicalTo(52)) ->willThrowException(new Exception()); @@ -87,7 +85,6 @@ public function testLoadWithNonPublishedContent(): void ); $this->loadServiceMock - ->expects(self::any()) ->method('loadContent') ->with(self::identicalTo(52)) ->willReturn($content); @@ -114,7 +111,6 @@ public function testLoadWithNoMainLocation(): void ); $this->loadServiceMock - ->expects(self::any()) ->method('loadContent') ->with(self::identicalTo(52)) ->willReturn($content); @@ -142,7 +138,6 @@ public function testLoadByRemoteId(): void ); $this->loadServiceMock - ->expects(self::any()) ->method('loadContentByRemoteId') ->with(self::identicalTo('abc')) ->willReturn($content); @@ -156,7 +151,6 @@ public function testLoadByRemoteId(): void public function testLoadByRemoteIdWithNoContent(): void { $this->loadServiceMock - ->expects(self::any()) ->method('loadContentByRemoteId') ->with(self::identicalTo('abc')) ->willThrowException(new Exception()); @@ -183,7 +177,6 @@ public function testLoadByRemoteIdWithNonPublishedContent(): void ); $this->loadServiceMock - ->expects(self::any()) ->method('loadContentByRemoteId') ->with(self::identicalTo('abc')) ->willReturn($content); @@ -210,7 +203,6 @@ public function testLoadByRemoteIdWithNoMainLocation(): void ); $this->loadServiceMock - ->expects(self::any()) ->method('loadContentByRemoteId') ->with(self::identicalTo('abc')) ->willReturn($content); diff --git a/tests/lib/Item/ValueLoader/LocationValueLoaderTest.php b/tests/lib/Item/ValueLoader/LocationValueLoaderTest.php index 02e1614..e78ad1d 100644 --- a/tests/lib/Item/ValueLoader/LocationValueLoaderTest.php +++ b/tests/lib/Item/ValueLoader/LocationValueLoaderTest.php @@ -43,7 +43,6 @@ public function testLoad(): void ); $this->loadServiceMock - ->expects(self::any()) ->method('loadLocation') ->with(self::identicalTo(52)) ->willReturn($location); @@ -57,7 +56,6 @@ public function testLoad(): void public function testLoadWithNoLocation(): void { $this->loadServiceMock - ->expects(self::any()) ->method('loadLocation') ->with(self::identicalTo(52)) ->willThrowException(new Exception()); @@ -81,7 +79,6 @@ public function testLoadWithNonPublishedContent(): void ); $this->loadServiceMock - ->expects(self::any()) ->method('loadLocation') ->with(self::identicalTo(52)) ->willReturn($location); @@ -106,7 +103,6 @@ public function testLoadByRemoteId(): void ); $this->loadServiceMock - ->expects(self::any()) ->method('loadLocationByRemoteId') ->with(self::identicalTo('abc')) ->willReturn($location); @@ -120,7 +116,6 @@ public function testLoadByRemoteId(): void public function testLoadByRemoteIdWithNoLocation(): void { $this->loadServiceMock - ->expects(self::any()) ->method('loadLocationByRemoteId') ->with(self::identicalTo('abc')) ->willThrowException(new Exception()); @@ -144,7 +139,6 @@ public function testLoadByRemoteIdWithNonPublishedContent(): void ); $this->loadServiceMock - ->expects(self::any()) ->method('loadLocationByRemoteId') ->with(self::identicalTo('abc')) ->willReturn($location); diff --git a/tests/lib/Parameters/ValueObjectProvider/ContentProviderTest.php b/tests/lib/Parameters/ValueObjectProvider/ContentProviderTest.php index 45239ff..63e7d90 100644 --- a/tests/lib/Parameters/ValueObjectProvider/ContentProviderTest.php +++ b/tests/lib/Parameters/ValueObjectProvider/ContentProviderTest.php @@ -28,7 +28,6 @@ protected function setUp(): void $this->loadServiceMock = $this->createMock(LoadService::class); $this->repositoryMock - ->expects(self::any()) ->method('sudo') ->with(self::anything()) ->willReturnCallback( @@ -50,7 +49,6 @@ public function testGetValueObject(): void $content = new Content(['contentInfo' => new ContentInfo(['mainLocationId' => 24])]); $this->loadServiceMock - ->expects(self::any()) ->method('loadContent') ->with(self::identicalTo(42)) ->willReturn($content); @@ -64,7 +62,6 @@ public function testGetValueObject(): void public function testGetValueObjectWithNonExistentLocation(): void { $this->loadServiceMock - ->expects(self::any()) ->method('loadContent') ->with(self::identicalTo(42)) ->willThrowException(new NotFoundException('content', 42)); @@ -80,7 +77,6 @@ public function testGetValueObjectWithNoMainLocation(): void $content = new Content(['contentInfo' => new ContentInfo(['mainLocationId' => null])]); $this->loadServiceMock - ->expects(self::any()) ->method('loadContent') ->with(self::identicalTo(42)) ->willReturn($content); diff --git a/tests/lib/Parameters/ValueObjectProvider/LocationProviderTest.php b/tests/lib/Parameters/ValueObjectProvider/LocationProviderTest.php index 532720a..bcbcc9a 100644 --- a/tests/lib/Parameters/ValueObjectProvider/LocationProviderTest.php +++ b/tests/lib/Parameters/ValueObjectProvider/LocationProviderTest.php @@ -27,7 +27,6 @@ protected function setUp(): void $this->loadServiceMock = $this->createMock(LoadService::class); $this->repositoryMock - ->expects(self::any()) ->method('sudo') ->with(self::anything()) ->willReturnCallback( @@ -49,7 +48,6 @@ public function testGetValueObject(): void $location = new Location(); $this->loadServiceMock - ->expects(self::any()) ->method('loadLocation') ->with(self::identicalTo(42)) ->willReturn($location); @@ -63,7 +61,6 @@ public function testGetValueObject(): void public function testGetValueObjectWithNonExistentLocation(): void { $this->loadServiceMock - ->expects(self::any()) ->method('loadLocation') ->with(self::identicalTo(42)) ->willThrowException(new NotFoundException('location', 42));