Skip to content

Commit

Permalink
FRW-8773 Added PHPUnit 11 support. (#11131)
Browse files Browse the repository at this point in the history
FRW-8773 Added PHP Unit 11 support.
  • Loading branch information
olhalivitchuk authored Nov 4, 2024
1 parent 53c1ba0 commit 5141d4a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ public function toArrayProvider(): array
return [
[
'isRecursive' => false,
'camelCase' => false,
'isCamelCase' => false,
'input' => $input,
'expected' => array_merge($underscoreOut, [
'test_transfer' => function ($value): void {
Expand All @@ -556,7 +556,7 @@ public function toArrayProvider(): array
],
[
'isRecursive' => true,
'camelCase' => false,
'isCamelCase' => false,
'input' => $input,
'expected' => array_merge($underscoreOut, [
'test_transfer' => [
Expand All @@ -569,7 +569,7 @@ public function toArrayProvider(): array
],
[
'isRecursive' => false,
'camelCase' => true,
'isCamelCase' => true,
'input' => $input,
'expected' => array_merge($camelCaseOut, [
'testTransfer' => function ($value): void {
Expand All @@ -579,7 +579,7 @@ public function toArrayProvider(): array
],
[
'isRecursive' => true,
'camelCase' => true,
'isCamelCase' => true,
'input' => $input,
'expected' => array_merge($camelCaseOut, [
'testTransfer' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -721,11 +721,11 @@ public function testInvalidAssociativeValueException(): void
* @dataProvider transferDefinitionTypeIsCorrectlyShimmedDataProvider
*
* @param array $shimConfig
* @param array<string> $expectedTypesTypes
* @param array<string> $expectedTypes
*
* @return void
*/
public function testTransferDefinitionTypeIsCorrectlyShimmed(array $shimConfig, array $expectedTypesTypes): void
public function testTransferDefinitionTypeIsCorrectlyShimmed(array $shimConfig, array $expectedTypes): void
{
// Arrange
$this->tester->mockConfigMethod('getTypeShims', $shimConfig);
Expand Down Expand Up @@ -762,7 +762,7 @@ public function testTransferDefinitionTypeIsCorrectlyShimmed(array $shimConfig,
$classDefinition->setDefinition($definition);

// Assert
$this->assertMethodHasCorrectTypeShim($classDefinition, $expectedTypesTypes);
$this->assertMethodHasCorrectTypeShim($classDefinition, $expectedTypes);
}

/**
Expand All @@ -772,40 +772,40 @@ public function transferDefinitionTypeIsCorrectlyShimmedDataProvider(): array
{
return [
'scalar type' => [
'shim config' => [
'shimConfig' => [
'FooBar' => [
'property1' => [
'int' => 'string',
],
],
],
'expected types' => [
'expectedTypes' => [
'property1',
'string|int|null',
],
],
'typed array type' => [
'shim config' => [
'shimConfig' => [
'FooBar' => [
'property2' => [
'string[]' => 'bool',
],
],
],
'expected types' => [
'expectedTypes' => [
'property2',
'bool|string[]',
],
],
'transfer type' => [
'shim config' => [
'shimConfig' => [
'FooBar' => [
'property3' => [
'array' => 'int',
],
],
],
'expected types' => [
'expectedTypes' => [
'property3',
'int|array',
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ protected function getTransferDefinitionBuilder(array $sourceDirectories, ?Trans
*/
protected function getTransferConfigMock(): TransferConfig
{
return $this->getMockBuilder(TransferConfig::class)->setMethods(['isTransferNameValidated'])->getMock();
return $this->getMockBuilder(TransferConfig::class)->onlyMethods(['isTransferNameValidated'])->getMock();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ protected function getMessengerMock(): ConsoleLogger
*/
protected function getTransferConfigMock(): TransferConfig
{
return $this->getMockBuilder(TransferConfig::class)->setMethods(['isTransferNameValidated'])->getMock();
return $this->getMockBuilder(TransferConfig::class)->onlyMethods(['isTransferNameValidated'])->getMock();
}

/**
Expand Down

0 comments on commit 5141d4a

Please # to comment.