Skip to content

Commit

Permalink
Fix the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GuilhemN committed Dec 10, 2020
1 parent fe9d420 commit 0564bdf
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
1 change: 0 additions & 1 deletion .phpunit.result.cache

This file was deleted.

2 changes: 1 addition & 1 deletion Negotiation/FormatNegotiator.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function add(RequestMatcherInterface $requestMatcher, array $options = []
$this->map[] = [$requestMatcher, $options];
}

public function getBest($header, array $priorities = [], $strict = false)
public function getBest($header, array $priorities = [], $strict = false): ?AcceptHeader
{
$request = $this->getRequest();
$header = $header ?: $request->headers->get('Accept');
Expand Down
14 changes: 7 additions & 7 deletions Tests/Functional/VersionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function testVersionAnnotation()
'/version?query_version=1.2',
[],
[],
['HTTP_Accept' => 'application/json']
['HTTP_ACCEPT' => 'application/json']
);
$this->assertEquals('{"version":"test annotation"}', static::$client->getResponse()->getContent());
}
Expand All @@ -49,7 +49,7 @@ public function testVersionInPathWithAnnotation()
'/version/1.2',
[],
[],
['HTTP_Accept' => 'application/json']
['HTTP_ACCEPT' => 'application/json']
);
$this->assertEquals(
'{"version":"test annotation","version_exclusion":"1.2"}',
Expand All @@ -64,7 +64,7 @@ public function testCustomHeaderVersion()
'/version?query_version=3.2',
[],
[],
['HTTP_Version-Header' => '2.1', 'HTTP_Accept' => 'application/vnd.foo.api+json;myversion=2.3']
['HTTP_Version-Header' => '2.1', 'HTTP_ACCEPT' => 'application/vnd.foo.api+json;myversion=2.3']
);
$this->assertEquals(
'{"version":"2.1","version_exclusion":"2.1"}',
Expand All @@ -79,7 +79,7 @@ public function testQueryVersion()
'/version?query_version=3.2',
[],
[],
['HTTP_Accept' => 'application/json']
['HTTP_ACCEPT' => 'application/json']
);
$this->assertEquals('{"version":"3.2","version_exclusion":"3.2"}', static::$client->getResponse()->getContent());
}
Expand All @@ -91,7 +91,7 @@ public function testAcceptHeaderVersion()
'/version?query_version=3.2',
[],
[],
['HTTP_Accept' => 'application/vnd.foo.api+json;myversion=2.3']
['HTTP_ACCEPT' => 'application/vnd.foo.api+json;myversion=2.3']
);

$response = static::$client->getResponse();
Expand All @@ -106,7 +106,7 @@ public function testDefaultVersion()
'/version',
[],
[],
['HTTP_Accept' => 'application/json']
['HTTP_ACCEPT' => 'application/json']
);
$this->assertEquals(
'{"version":"3.4.2","version_exclusion":"3.4.2"}',
Expand All @@ -121,7 +121,7 @@ public function testVersionInPath()
'/version/2.3',
[],
[],
['HTTP_Accept' => 'application/json']
['HTTP_ACCEPT' => 'application/json']
);
$this->assertEquals(
'{"version":"2.3","version_exclusion":"2.3"}',
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
},
"require-dev": {
"sensio/framework-extra-bundle": "^5.2.3",
"symfony/phpunit-bridge": "^4.1.8|^5.0",
"symfony/phpunit-bridge": "^5.2",
"symfony/asset": "^4.4|^5.0",
"symfony/form": "^4.4|^5.0",
"symfony/mime": "^4.4|^5.0",
Expand Down

0 comments on commit 0564bdf

Please sign in to comment.