Skip to content

Commit 3579805

Browse files
authored
Bump PHPUnit 9.5 and update test (#14)
* bump version * update test for phpunit 9
1 parent 1ee41c4 commit 3579805

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"illuminate/http": "^5.0|^6.0|^7.0|^8.0|^v9.0"
1414
},
1515
"require-dev": {
16-
"phpunit/phpunit": "~5.4.0"
16+
"phpunit/phpunit": "^9.5"
1717
},
1818
"license": "MIT",
1919
"authors": [

tests/XmlRequestMacrosTest.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@
77

88
class XmlRequestMacrosTest extends TestCase
99
{
10-
public function setup()
10+
public function setUp():void
1111
{
1212
if (!Request::hasMacro('xml') || !Request::hasMacro('isXml')) {
1313
(new XmlRequestServiceProvider(null))->register();
1414
}
1515
}
1616

17-
protected function createRequest($headers = [], $content = null)
17+
protected function createRequest($headers = [], $content = null): Request
1818
{
1919
return new Request([], [], [], [], [], $headers, $content);
2020
}
2121

22-
public function contentTypeDataProvider()
22+
public function contentTypeDataProvider(): array
2323
{
2424
return [
2525
['application/xml', true, '<xml><person>human</person></xml>', ['person' => 'human']],
@@ -35,20 +35,20 @@ public function contentTypeDataProvider()
3535
* @param string $contentType
3636
* @param bool $assertion
3737
*/
38-
public function testIsXmlMethod($contentType, $assertion)
38+
public function testIsXmlMethod(string $contentType, bool$assertion):void
3939
{
4040
$this->assertEquals($assertion, $this->createRequest(['CONTENT_TYPE' => $contentType])->isXml());
4141
}
4242

4343
/**
4444
* @dataProvider contentTypeDataProvider
4545
*
46-
* @param $contentType
47-
* @param $typeAssertion
48-
* @param $content
49-
* @param string $expectedContent
46+
* @param string $contentType
47+
* @param bool $typeAssertion
48+
* @param string $content
49+
* @param array $expectedContent
5050
*/
51-
public function testXmlMethod($contentType, $typeAssertion, $content, $expectedContent = '')
51+
public function testXmlMethod(string $contentType, bool $typeAssertion, string $content, array $expectedContent = []):void
5252
{
5353
$request = $this->createRequest(['CONTENT_TYPE' => $contentType], $content);
5454
if ($typeAssertion) {
@@ -63,12 +63,12 @@ public function testXmlMethod($contentType, $typeAssertion, $content, $expectedC
6363
/**
6464
* @dataProvider contentTypeDataProvider
6565
*
66-
* @param $contentType
67-
* @param $isXml
68-
* @param $content
69-
* @param string $expectedContent
66+
* @param string $contentType
67+
* @param bool $isXml
68+
* @param string $content
69+
* @param array $expectedContent
7070
*/
71-
public function testXmlMiddleware($contentType, $isXml, $content, $expectedContent = '')
71+
public function testXmlMiddleware(string $contentType, bool $isXml, string $content, array $expectedContent = []):void
7272
{
7373
$request = $this->createRequest(['CONTENT_TYPE' => $contentType], $content);
7474
// Make sure we have an empty array before middleware

0 commit comments

Comments
 (0)