Skip to content

Commit

Permalink
[TASK] Test test changes
Browse files Browse the repository at this point in the history
  • Loading branch information
georgringer committed May 1, 2024
1 parent 8bfd611 commit 2bc0860
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Tests/Unit/Command/GeocodeCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function configurationIsProperlyConfigured()
*/
public function geocodeServiceIsReturned()
{
$subject = $this->getAccessibleMock(GeocodeCommand::class, ['dummy'], [], '', false);
$subject = $this->getAccessibleMock(GeocodeCommand::class, [], [], '', false);
$service = $subject->_call('getGeocodeService', '123');
$this->assertEquals(GeocodeService::class, get_class($service));
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/Unit/Controller/AddressControllerPaginationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public function paginationIsCorrectlyTriggered()
$mockedRequest->expects($this->once())->method('hasArgument')->with('currentPage')->willReturn(true);
$mockedRequest->expects($this->once())->method('getArgument')->with('currentPage')->willReturn(2);

$subject = $this->getAccessibleMock(AddressController::class, ['dummy'], [], '', false);
$subject = $this->getAccessibleMock(AddressController::class, [], [], '', false);
$subject->_set('settings', $settings);
$subject->_set('request', $mockedRequest);

Expand Down
16 changes: 8 additions & 8 deletions Tests/Unit/Controller/AddressControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected function setUp(): void
*/
public function dotIsRemovedFromEnd($given, $expected)
{
$subject = $this->getAccessibleMock(AddressController::class, ['dummy'], [], '', false);
$subject = $this->getAccessibleMock(AddressController::class, [], [], '', false);
$this->assertEquals($expected, $subject->_call('removeDotAtTheEnd', $given));
}

Expand All @@ -61,7 +61,7 @@ public function dotIsRemovedFromEndDataProvider(): array
*/
public function dotsAreRemovedFromArray()
{
$subject = $this->getAccessibleMock(AddressController::class, ['dummy'], [], '', false);
$subject = $this->getAccessibleMock(AddressController::class, [], [], '', false);
$given = [
'example' => 'some string',
'example2' => '123',
Expand Down Expand Up @@ -91,7 +91,7 @@ public function initializeActionWorks()
$packageManagerProphecy = $this->prophesize(PackageManager::class);
GeneralUtility::setSingletonInstance(PackageManager::class, $packageManagerProphecy->reveal());

$subject = $this->getAccessibleMock(AddressController::class, ['dummy'], [], '', false);
$subject = $this->getAccessibleMock(AddressController::class, [], [], '', false);
$subject->_set('extensionConfiguration', $this->getMockedSettings());
$subject->initializeAction();

Expand All @@ -105,9 +105,9 @@ public function initializeActionWorks()
*/
public function injectAddressRepositoryWorks()
{
$mockedRepository = $this->getAccessibleMock(AddressRepository::class, ['dummy'], [], '', false);
$mockedRepository = $this->getAccessibleMock(AddressRepository::class, [], [], '', false);

$subject = $this->getAccessibleMock(AddressController::class, ['dummy'], [], '', false);
$subject = $this->getAccessibleMock(AddressController::class, [], [], '', false);
$subject->injectAddressRepository($mockedRepository);

$this->assertEquals($mockedRepository, $subject->_get('addressRepository'));
Expand All @@ -123,7 +123,7 @@ public function pidListIsReturned()
->withConsecutive([123, 3], [456, 3])
->willReturnOnConsecutiveCalls('7,8,9', '');

$subject = $this->getAccessibleMock(AddressController::class, ['dummy'], [], '', false);
$subject = $this->getAccessibleMock(AddressController::class, [], [], '', false);
$subject->_set('queryGenerator', $mockedQueryGenerator);
$subject->_set('settings', [
'pages' => '123,456',
Expand Down Expand Up @@ -166,7 +166,7 @@ public function settingsAreProperlyInjected()
]
);

$subject = $this->getAccessibleMock(AddressController::class, ['dummy'], [], '', false);
$subject = $this->getAccessibleMock(AddressController::class, [], [], '', false);
$expectedSettings = [
'key1' => 'value1',
'orderByAllowed' => 'sorting',
Expand Down Expand Up @@ -360,7 +360,7 @@ public function overrideDemandMethodIsCalledIfEnabled()
*/
public function overrideDemandWorks(Demand $demandIn, Demand $demandOut, array $override)
{
$subject = $this->getAccessibleMock(AddressController::class, ['dummy'], [], '', false);
$subject = $this->getAccessibleMock(AddressController::class, [], [], '', false);

$this->assertEquals($demandOut, $subject->_call('overrideDemand', $demandIn, $override));
}
Expand Down
6 changes: 3 additions & 3 deletions Tests/Unit/Domain/Model/AddressTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public function roomCanBeSet()
$this->assertEquals($value, $this->subject->getRoom());
}

public function telephoneFormatDataProvider()
public static function telephoneFormatDataProvider()
{
return [
'phone number' => ['0122333', '0122333'],
Expand Down Expand Up @@ -254,7 +254,7 @@ public function simplifiedWwwIsReturned(string $given, string $expected)
$this->assertEquals($expected, $this->subject->getWwwSimplified());
}

public function simplifiedWwwIsReturnedDataProvider()
public static function simplifiedWwwIsReturnedDataProvider()
{
return [
'empty' => ['', ''],
Expand Down Expand Up @@ -529,7 +529,7 @@ public function fullNameIsReturned(string $expected, array $nameParts): void
$this->assertEquals($expected, $this->subject->getFullName());
}

public function fullNameDataProvider(): array
public static function fullNameDataProvider(): array
{
return [
'simple name' => ['John Doe', ['', 'John', 'Doe', '']],
Expand Down
2 changes: 1 addition & 1 deletion Tests/Unit/Evaluation/LatitudeEvaluationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function latIsProperlyDeEvaluated($given, $expected)
$this->assertEquals($expected, $this->subject->deevaluateFieldValue($params));
}

public function latIsProperlyEvaluatedDataProvider(): array
public static function latIsProperlyEvaluatedDataProvider(): array
{
return [
'empty string' => ['', ''],
Expand Down
2 changes: 1 addition & 1 deletion Tests/Unit/Evaluation/LongitudeEvaluationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function lngIsProperlyDeEvaluated($given, $expected)
$this->assertEquals($expected, $this->subject->deevaluateFieldValue($params));
}

public function lngIsProperlyEvaluatedDataProvider(): array
public static function lngIsProperlyEvaluatedDataProvider(): array
{
return [
'empty string' => ['', ''],
Expand Down
4 changes: 2 additions & 2 deletions Tests/Unit/Evaluation/TelephoneEvaluationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function setUp(): void
*/
public function constructorIsCalled()
{
$subject = $this->getAccessibleMock(TelephoneEvaluation::class, ['dummy'], [], '', true);
$subject = $this->getAccessibleMock(TelephoneEvaluation::class, [], [], '', true);

$settings = new Settings();
$this->assertEquals($settings, $subject->_get('extensionSettings'));
Expand Down Expand Up @@ -73,7 +73,7 @@ public function telephoneIsProperlyDeEvaluated($given, $expected)
$this->assertEquals($expected, $this->subject->deevaluateFieldValue($params));
}

public function telephoneIsProperlyEvaluatedDataProvider(): array
public static function telephoneIsProperlyEvaluatedDataProvider(): array
{
return [
'empty string' => ['', ''],
Expand Down
4 changes: 2 additions & 2 deletions Tests/Unit/Hooks/Tca/AddFieldsToSelectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ class AddFieldsToSelectorTest extends BaseTestCase
*/
public function constructorIsCalled()
{
$languageService = $this->getAccessibleMock(LanguageService::class, ['dummy'], [], '', false, false);
$languageService = $this->getAccessibleMock(LanguageService::class, [], [], '', false, false);
$GLOBALS['LANG'] = $languageService;

$subject = $this->getAccessibleMock(AddFieldsToSelector::class, ['dummy'], [], '', true);
$subject = $this->getAccessibleMock(AddFieldsToSelector::class, [], [], '', true);
$this->assertEquals($languageService, $subject->_get('languageService'));
}

Expand Down
4 changes: 2 additions & 2 deletions Tests/Unit/Seo/AddressTitleProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ public function correctTitleIsGenerated(string $expected, array $addressFields,
$address->$setter($value);
}

$mockedProvider = $this->getAccessibleMock(AddressTitleProvider::class, ['dummy'], [], '', false);
$mockedProvider = $this->getAccessibleMock(AddressTitleProvider::class, [], [], '', false);
$mockedProvider->setTitle($address, $configuration);

$this->assertEquals($expected, $mockedProvider->getTitle());
}

public function addressTitleProvider(): array
public static function addressTitleProvider(): array
{
return [
'basic example' => [
Expand Down
6 changes: 3 additions & 3 deletions Tests/Unit/Service/GeocodeServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function validAPiResultIsReturned()

GeneralUtility::addInstance(RequestFactory::class, $requestFactory->reveal());

$subject = $this->getAccessibleMock(GeocodeService::class, ['dummy'], [], '', false);
$subject = $this->getAccessibleMock(GeocodeService::class, [], [], '', false);
$apiResponse = $subject->_call('getApiCallResult', 'http://dummy.com');
$this->assertEquals($content, $apiResponse);
}
Expand All @@ -51,7 +51,7 @@ public function invalidAPiResultReturnsEmptyArray()

GeneralUtility::addInstance(RequestFactory::class, $requestFactory->reveal());

$subject = $this->getAccessibleMock(GeocodeService::class, ['dummy'], [], '', false);
$subject = $this->getAccessibleMock(GeocodeService::class, [], [], '', false);
$apiResponse = $subject->_call('getApiCallResult', 'http://dummy.com');
$this->assertEquals([], $apiResponse);
}
Expand All @@ -63,7 +63,7 @@ public function wrongCacheThrowsException()
{
$this->expectException(\RuntimeException::class);
$this->expectExceptionCode(1548785854);
$subject = $this->getAccessibleMock(GeocodeService::class, ['dummy'], [], '', false);
$subject = $this->getAccessibleMock(GeocodeService::class, [], [], '', false);
$subject->_call('initializeCache', 'notExisting');
}
}

0 comments on commit 2bc0860

Please sign in to comment.