Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Art4 committed Oct 8, 2024
1 parent 912a055 commit c98fa15
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/Redmine/Serializer/XmlSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ private function denormalize(array $normalized): void
}

/**
* @param array<mixed> $params
* @param string|array<mixed> $params
*/
private function createXmlElement(string $rootElementName, array $params): SimpleXMLElement
private function createXmlElement(string $rootElementName, $params): SimpleXMLElement
{
$value = '';
if (! is_array($params)) {
Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/Psr18ClientRequestGenerationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function testPsr18ClientCreatesCorrectRequests(
return new Request($method, $uri);
});

$streamFactory = new class () implements StreamFactoryInterface {
$streamFactory = new class implements StreamFactoryInterface {
public function createStream(string $content = ''): StreamInterface
{
return Utils::streamFor($content);
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Client/NativeCurlClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ public function testGetApiShouldThrowException(): void
);

$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('`do_not_exist` is not a valid api. Possible apis are `attachment`, `group`, `custom_fields`, `issue`, `issue_category`, `issue_priority`, `issue_relation`, `issue_status`, `membership`, `news`, `project`, `query`, `role`, `time_entry`, `time_entry_activity`, `tracker`, `user`, `version`, `wiki`, `search`');
$this->expectExceptionMessage('`do_not_exist` is not a valid api. Possible apis are `attachment`, `group`, `custom_fields`, `issue`, `issue_category`, `issue_priority`, `issue_relation`, `issue_status`, `membership`, `news`, `project`, `query`, `role`, `search`, `time_entry`, `time_entry_activity`, `tracker`, `user`, `version`, `wiki`');

$client->getApi('do_not_exist');
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Client/Psr18ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ public function testGetApiShouldThrowException(): void
);

$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('`do_not_exist` is not a valid api. Possible apis are `attachment`, `group`, `custom_fields`, `issue`, `issue_category`, `issue_priority`, `issue_relation`, `issue_status`, `membership`, `news`, `project`, `query`, `role`, `time_entry`, `time_entry_activity`, `tracker`, `user`, `version`, `wiki`, `search`');
$this->expectExceptionMessage('`do_not_exist` is not a valid api. Possible apis are `attachment`, `group`, `custom_fields`, `issue`, `issue_category`, `issue_priority`, `issue_relation`, `issue_status`, `membership`, `news`, `project`, `query`, `role`, `search`, `time_entry`, `time_entry_activity`, `tracker`, `user`, `version`, `wiki`');

$client->getApi('do_not_exist');
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/Serializer/JsonSerializerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public static function getEncodedToNormalizedData(): array
* @dataProvider getEncodedToNormalizedData
*/
#[DataProvider('getEncodedToNormalizedData')]
public function testCreateFromStringDecodesToExpectedNormalizedData(string $data, string $expected): void
public function testCreateFromStringDecodesToExpectedNormalizedData(string $data, $expected): void
{
$serializer = JsonSerializer::createFromString($data);

Expand Down Expand Up @@ -184,7 +184,7 @@ public static function getNormalizedToEncodedData(): array
* @dataProvider getNormalizedToEncodedData
*/
#[DataProvider('getNormalizedToEncodedData')]
public function testCreateFromArrayEncodesToExpectedString(array $data, string $expected): void
public function testCreateFromArrayEncodesToExpectedString(array $data, $expected): void
{
$serializer = JsonSerializer::createFromArray($data);

Expand Down

0 comments on commit c98fa15

Please sign in to comment.