77
88class 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