Skip to content

Commit

Permalink
🐛 Use static instead of this (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-rose authored Jul 3, 2023
1 parent 483e7cb commit 107f592
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,28 +55,28 @@ protected function _before(): void
*/
public function testSearch(): void
{
$this->factoryMock->expects($this->atLeastOnce())
$this->factoryMock->expects(static::atLeastOnce())
->method('createSearchQuery')
->willReturn($this->queryMock);

$this->factoryMock->expects($this->atLeastOnce())
$this->factoryMock->expects(static::atLeastOnce())
->method('getSearchClient')
->willReturn($this->searchClientMock);

$this->factoryMock->expects($this->atLeastOnce())
$this->factoryMock->expects(static::atLeastOnce())
->method('getSearchQueryExpanderPlugins')
->willReturn([]);

$this->searchClientMock->expects($this->atLeastOnce())
$this->searchClientMock->expects(static::atLeastOnce())
->method('expandQuery')
->with($this->queryMock, [], [])
->willReturn($this->queryMock);

$this->factoryMock->expects($this->atLeastOnce())
$this->factoryMock->expects(static::atLeastOnce())
->method('getSearchResultFormatterPlugins')
->willReturn([]);

$this->searchClientMock->expects($this->atLeastOnce())
$this->searchClientMock->expects(static::atLeastOnce())
->method('search')
->with($this->queryMock, [], [])
->willReturn([]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ protected function _before(): void
*/
public function testSearch(): void
{
$this->searchClientMock->expects($this->atLeastOnce())
$this->searchClientMock->expects(static::atLeastOnce())
->method('search')
->with($this->queryMock)
->willReturn([]);
Expand All @@ -58,7 +58,7 @@ public function testSearch(): void
*/
public function testExpandQuery(): void
{
$this->searchClientMock->expects($this->atLeastOnce())
$this->searchClientMock->expects(static::atLeastOnce())
->method('expandQuery')
->with($this->queryMock, [])
->willReturn($this->queryMock);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ protected function _before(): void
*/
public function testCreateConditionalAvailabilityPeriodPageSearchPublisher(): void
{
$this->containerMock->expects($this->atLeastOnce())
$this->containerMock->expects(static::atLeastOnce())
->method('has')
->willReturn(true);

$this->containerMock->expects($this->atLeastOnce())
$this->containerMock->expects(static::atLeastOnce())
->method('get')
->withConsecutive(
[ConditionalAvailabilityPageSearchDependencyProvider::FACADE_STORE],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function testGetConditionalAvailabilityIdsByConcreteIds(): void
*/
public function testPublish(): void
{
$this->factoryMock->expects($this->atLeastOnce())
$this->factoryMock->expects(static::atLeastOnce())
->method('createConditionalAvailabilityPeriodPageSearchPublisher')
->willReturn($this->publisherMock);

Expand All @@ -77,7 +77,7 @@ public function testPublish(): void
*/
public function testUnpublish(): void
{
$this->factoryMock->expects($this->atLeastOnce())
$this->factoryMock->expects(static::atLeastOnce())
->method('createConditionalAvailabilityPeriodPageSearchUnpublisher')
->willReturn($this->unpublisherMock);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ protected function _before(): void
*/
public function testMapConditionalAvailabilityPeriodDataToSearchData(): void
{
$this->storeFacadeMock->expects($this->atLeastOnce())
$this->storeFacadeMock->expects(static::atLeastOnce())
->method('getCurrentStore')
->willReturn($this->storeTransferMock);

$this->storeTransferMock->expects($this->atLeastOnce())
$this->storeTransferMock->expects(static::atLeastOnce())
->method('getName')
->willReturn('store');

$this->pluginMocks[0]->expects($this->atLeastOnce())
$this->pluginMocks[0]->expects(static::atLeastOnce())

Check failure on line 70 in tests/FondOfImpala/Zed/ConditionalAvailabilityPageSearch/Business/Model/ConditionalAvailabilityPeriodPageSearchDataMapperTest.php

View workflow job for this annotation

GitHub Actions / continous-integration (8.0)

Call to an undefined method FondOfImpala\Zed\ConditionalAvailabilityPageSearchExtension\Dependency\Plugin\ConditionalAvailabilityPeriodPageSearchDataExpanderPluginInterface::expects().

Check failure on line 70 in tests/FondOfImpala/Zed/ConditionalAvailabilityPageSearch/Business/Model/ConditionalAvailabilityPeriodPageSearchDataMapperTest.php

View workflow job for this annotation

GitHub Actions / continous-integration (8.1)

Call to an undefined method FondOfImpala\Zed\ConditionalAvailabilityPageSearchExtension\Dependency\Plugin\ConditionalAvailabilityPeriodPageSearchDataExpanderPluginInterface::expects().

Check failure on line 70 in tests/FondOfImpala/Zed/ConditionalAvailabilityPageSearch/Business/Model/ConditionalAvailabilityPeriodPageSearchDataMapperTest.php

View workflow job for this annotation

GitHub Actions / continous-integration (8.2)

Call to an undefined method FondOfImpala\Zed\ConditionalAvailabilityPageSearchExtension\Dependency\Plugin\ConditionalAvailabilityPeriodPageSearchDataExpanderPluginInterface::expects().
->method('expand')
->willReturnArgument(1);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,36 +73,36 @@ public function testExpand(): void
$idConditionalAvailability = 1;
$storeName = 'store-name';

$this->conditionalAvailabilityPeriodPageSearchTransferMock->expects($this->atLeastOnce())
$this->conditionalAvailabilityPeriodPageSearchTransferMock->expects(static::atLeastOnce())
->method('getStartAt')
->willReturn($startAt);

$this->conditionalAvailabilityPeriodPageSearchTransferMock->expects($this->atLeastOnce())
$this->conditionalAvailabilityPeriodPageSearchTransferMock->expects(static::atLeastOnce())
->method('getEndAt')
->willReturn($endAt);

$this->conditionalAvailabilityPeriodPageSearchTransferMock->expects($this->atLeastOnce())
$this->conditionalAvailabilityPeriodPageSearchTransferMock->expects(static::atLeastOnce())
->method('getFkConditionalAvailability')
->willReturn($idConditionalAvailability);

$this->storeFacadeMock->expects($this->atLeastOnce())
$this->storeFacadeMock->expects(static::atLeastOnce())
->method('getCurrentStore')
->willReturn($this->storeTransferMock);

$this->storeTransferMock->expects($this->atLeastOnce())
$this->storeTransferMock->expects(static::atLeastOnce())
->method('getName')
->willReturn($storeName);

$this->conditionalAvailabilityPeriodPageSearchTransferMock->expects($this->atLeastOnce())
$this->conditionalAvailabilityPeriodPageSearchTransferMock->expects(static::atLeastOnce())
->method('setConditionalAvailabilityPeriodKey')
->willReturnSelf();

$this->conditionalAvailabilityPeriodPageSearchTransferMock->expects($this->atLeastOnce())
$this->conditionalAvailabilityPeriodPageSearchTransferMock->expects(static::atLeastOnce())
->method('setStoreName')
->with($storeName)
->willReturnSelf();

$this->conditionalAvailabilityPeriodPageDataExpanderPluginMock->expects($this->atLeastOnce())
$this->conditionalAvailabilityPeriodPageDataExpanderPluginMock->expects(static::atLeastOnce())
->method('expand')
->with($this->conditionalAvailabilityPeriodPageSearchTransferMock)
->willReturn($this->conditionalAvailabilityPeriodPageSearchTransferMock);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ protected function _before(): void
*/
public function testGetEventBehaviorFacade(): void
{
$this->containerMock->expects($this->atLeastOnce())
$this->containerMock->expects(static::atLeastOnce())
->method('has')
->willReturn(true);

$this->containerMock->expects($this->atLeastOnce())
$this->containerMock->expects(static::atLeastOnce())
->method('get')
->with(ConditionalAvailabilityPageSearchDependencyProvider::FACADE_EVENT_BEHAVIOR)
->willReturn($this->eventBehaviorFacadeMock);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function testGetEventTransferIds(): void
{
$eventTransfers = [$this->eventEntityTransferMock];

$this->eventBehaviorFacadeMock->expects($this->atLeastOnce())
$this->eventBehaviorFacadeMock->expects(static::atLeastOnce())
->method('getEventTransferIds')
->with($eventTransfers)
->willReturn([]);
Expand All @@ -63,7 +63,7 @@ public function testGetEventTransferForeignKeys(): void
$eventTransfers = [$this->eventEntityTransferMock];
$foreignKeyColumnName = 'foreign-key-column-name';

$this->eventBehaviorFacadeMock->expects($this->atLeastOnce())
$this->eventBehaviorFacadeMock->expects(static::atLeastOnce())
->method('getEventTransferForeignKeys')
->with($eventTransfers, $foreignKeyColumnName)
->willReturn([]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ protected function _before(): void
*/
public function testGetCurrentStore(): void
{
$this->storeFacadeMock->expects($this->atLeastOnce())
$this->storeFacadeMock->expects(static::atLeastOnce())
->method('getCurrentStore')
->willReturn($this->storeTransferMock);

$this->assertEquals($this->storeTransferMock, $this->bridge->getCurrentStore());
static::assertEquals($this->storeTransferMock, $this->bridge->getCurrentStore());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function testEncodeJson(): void
{
$encodedJsonString = 'encoded-json-string';

$this->utilEncodingServiceMock->expects($this->atLeastOnce())
$this->utilEncodingServiceMock->expects(static::atLeastOnce())
->method('encodeJson')
->with([])
->willReturn($encodedJsonString);
Expand All @@ -54,7 +54,7 @@ public function testDecodeJson(): void
{
$encodedJsonString = 'encoded-json-string';

$this->utilEncodingServiceMock->expects($this->atLeastOnce())
$this->utilEncodingServiceMock->expects(static::atLeastOnce())
->method('decodeJson')
->with($encodedJsonString)
->willReturn([]);
Expand Down

0 comments on commit 107f592

Please sign in to comment.