Skip to content

Commit

Permalink
fix(test): prevent error by upgrading suites
Browse files Browse the repository at this point in the history
  • Loading branch information
joerivanveen committed Nov 28, 2024
1 parent 962c4cc commit a39bb8d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/Support/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -1732,11 +1732,11 @@ static function ($value) {
return Helpers::toArrayWithoutNull($value);
}

if ($value && method_exists($value, 'toArrayWithoutNull')) {
if ($value && method_exists((string) $value, 'toArrayWithoutNull')) {
return $value->toArrayWithoutNull();
}

if ($value && method_exists($value, 'toArray')) {
if ($value && method_exists((string) $value, 'toArray')) {
return $value->toArray();
}

Expand All @@ -1754,7 +1754,7 @@ static function ($value) {
public function jsonSerialize()
{
return array_map(function ($value) {
if (method_exists($value, 'toArray')) {
if (method_exists((string) $value, 'toArray')) {
return $value->toArray();
}

Expand Down
2 changes: 1 addition & 1 deletion test/Model/MyParcelRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function testGetHeaders(): void
);

$headers = $request->getHeaders();
self::assertContains('MyECommercePlatform/4.4.0', Arr::wrap($headers['User-Agent']));
self::assertMatchesRegularExpression('|MyECommercePlatform/4.4.0|', $headers['User-Agent']);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions test/TrackTraceUrl/TrackTraceUrlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ public static function provideTrackTraceData(): array
return [
'dutch destination' => [
'barcode' => '3SMYPA00123456',
'postal_code' => '2132JE',
'cc' => 'NL',
'postalCode' => '2132JE',
'countryCode' => 'NL',
],
];
}
Expand Down

0 comments on commit a39bb8d

Please sign in to comment.