Skip to content

Fix data provider in FixturesTest #283

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions tests/Util/FixturesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,14 @@ public function testCoverageOfFixtures(): void
*
* @dataProvider xmlFileToFunctionMapping
*/
public function testStructureOfFixturesIsStillUpToDate(string $requestFunction, string $filename, bool $success, string $messageKey, ?\Closure $parameters): void
public function testStructureOfFixturesIsStillUpToDate(string $method, string $filename, bool $success, string $messageKey, ?\Closure $parameters): void
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think $method is more suitable than $function or $requestFunction, because it is, in fact, a method and not a function.

{
// get parameters by closure from data provider
$requestParameters = ($parameters) ? $parameters($this->bbb) : null;

// make the request and get the XML of the response
/** @var BaseResponse $response */
$response = $this->bbb->{$requestFunction}($requestParameters);
$response = $this->bbb->{$method}($requestParameters);
$xmlAsIs = $response->getRawXml();

// load the XML of the fixture
Expand Down Expand Up @@ -158,18 +158,18 @@ public function testStructureOfFixturesIsStillUpToDate(string $requestFunction,
*
* @return array<string, array<string, mixed>>
*/
private function xmlFileToFunctionMapping(): array
public static function xmlFileToFunctionMapping(): array
{
return [
'case01_api_version' => [
'function' => 'getApiVersion',
'method' => 'getApiVersion',
'filename' => 'api_version.xml',
'success' => true,
'messageKey' => '',
'parameters' => null,
],
'case02_create_meeting' => [
'function' => 'createMeeting',
'method' => 'createMeeting',
'filename' => 'create_meeting.xml',
'success' => true,
'messageKey' => '',
Expand All @@ -178,7 +178,7 @@ private function xmlFileToFunctionMapping(): array
},
],
'case03_join_meeting' => [
'function' => 'joinMeeting',
'method' => 'joinMeeting',
'filename' => 'join_meeting.xml',
'success' => true,
'messageKey' => 'successfullyJoined',
Expand All @@ -200,7 +200,7 @@ private function xmlFileToFunctionMapping(): array
},
],
'case04_end_meeting' => [
'function' => 'endMeeting',
'method' => 'endMeeting',
'filename' => 'end_meeting.xml',
'success' => true,
'messageKey' => 'sentEndMeetingRequest',
Expand All @@ -216,7 +216,7 @@ private function xmlFileToFunctionMapping(): array
},
],
'case05_is_meeting_running' => [
'function' => 'isMeetingRunning',
'method' => 'isMeetingRunning',
'filename' => 'is_meeting_running.xml',
'success' => true,
'messageKey' => '',
Expand All @@ -232,7 +232,7 @@ private function xmlFileToFunctionMapping(): array
},
],
'case06_list_of_meetings' => [
'function' => 'getMeetings',
'method' => 'getMeetings',
'filename' => 'get_meetings.xml',
'success' => true,
'messageKey' => '',
Expand Down Expand Up @@ -262,7 +262,7 @@ private function xmlFileToFunctionMapping(): array
},
],
'case07_meeting_info_of_meeting_without_breakout_rooms' => [
'function' => 'getMeetingInfo',
'method' => 'getMeetingInfo',
'filename' => 'get_meeting_info.xml',
'success' => true,
'messageKey' => '',
Expand Down Expand Up @@ -291,7 +291,7 @@ private function xmlFileToFunctionMapping(): array
},
],
'case08_meeting_info_of_breakout_room' => [
'function' => 'getMeetingInfo',
'method' => 'getMeetingInfo',
'filename' => 'get_meeting_info_breakout_room.xml',
'success' => true,
'messageKey' => '',
Expand Down Expand Up @@ -321,7 +321,7 @@ private function xmlFileToFunctionMapping(): array
},
],
'case09_meeting_info_of_meeting_with_breakout_rooms' => [
'function' => 'getMeetingInfo',
'method' => 'getMeetingInfo',
'filename' => 'get_meeting_info_with_breakout_rooms.xml',
'success' => true,
'messageKey' => '',
Expand Down Expand Up @@ -354,7 +354,7 @@ private function xmlFileToFunctionMapping(): array
},
],
'case10_hooks_create' => [
'function' => 'hooksCreate',
'method' => 'hooksCreate',
'filename' => 'hooks_create.xml',
'success' => true,
'messageKey' => '',
Expand All @@ -364,7 +364,7 @@ private function xmlFileToFunctionMapping(): array
},
],
'case11_hooks_create_existing' => [
'function' => 'hooksCreate',
'method' => 'hooksCreate',
'filename' => 'hooks_create_existing.xml',
'success' => true,
'messageKey' => 'duplicateWarning',
Expand All @@ -381,7 +381,7 @@ private function xmlFileToFunctionMapping(): array
},
],
'case12_hooks_list' => [
'function' => 'hooksList',
'method' => 'hooksList',
'filename' => 'hooks_list.xml',
'success' => true,
'messageKey' => '',
Expand All @@ -405,7 +405,7 @@ private function xmlFileToFunctionMapping(): array
},
],
'case13_hooks_destroy' => [
'function' => 'hooksDestroy',
'method' => 'hooksDestroy',
'filename' => 'hooks_destroy.xml',
'success' => true,
'messageKey' => '',
Expand All @@ -421,7 +421,7 @@ private function xmlFileToFunctionMapping(): array
},
],
'case14_hooks_destroy_not_found' => [
'function' => 'hooksDestroy',
'method' => 'hooksDestroy',
'filename' => 'hooks_destroy_failed_not_found.xml',
'success' => false,
'messageKey' => 'destroyMissingHook',
Expand All @@ -431,7 +431,7 @@ private function xmlFileToFunctionMapping(): array
},
],
'case15_insert_document' => [
'function' => 'insertDocument',
'method' => 'insertDocument',
'filename' => 'insert_document.xml',
'success' => true,
'messageKey' => 'documentInserted',
Expand Down