From 4f0e8f2e1d80c3411d2f7047007af9710fcf837e Mon Sep 17 00:00:00 2001 From: Danny van der Sluijs Date: Sun, 26 May 2024 21:23:33 +0200 Subject: [PATCH] style: Correct code style violations --- tests/Uri/Retrievers/FileGetContentsTest.php | 83 ++++++++++---------- 1 file changed, 41 insertions(+), 42 deletions(-) diff --git a/tests/Uri/Retrievers/FileGetContentsTest.php b/tests/Uri/Retrievers/FileGetContentsTest.php index bd284f2c..2301f3bc 100644 --- a/tests/Uri/Retrievers/FileGetContentsTest.php +++ b/tests/Uri/Retrievers/FileGetContentsTest.php @@ -1,50 +1,49 @@ retrieve(__DIR__ . '/Fixture/missing.json'); + } + + public function testFetchFile() + { + $res = new FileGetContents(); + $result = $res->retrieve(__DIR__ . '/../Fixture/child.json'); + $this->assertNotEmpty($result); + } + + public function testContentType() + { + $res = new FileGetContents(); + + $reflector = new \ReflectionObject($res); + $fetchContentType = $reflector->getMethod('fetchContentType'); + $fetchContentType->setAccessible(true); + + $this->assertTrue($fetchContentType->invoke($res, array('Content-Type: application/json'))); + $this->assertFalse($fetchContentType->invoke($res, array('X-Some-Header: whateverValue'))); + } + + public function testCanHandleHttp301PermanentRedirect() { - /** - * @expectedException \JsonSchema\Exception\ResourceNotFoundException - */ - public function testFetchMissingFile() - { - $res = new FileGetContents(); - $res->retrieve(__DIR__ . '/Fixture/missing.json'); - } - - public function testFetchFile() - { - $res = new FileGetContents(); - $result = $res->retrieve(__DIR__ . '/../Fixture/child.json'); - $this->assertNotEmpty($result); - } - - public function testContentType() - { - $res = new FileGetContents(); - - $reflector = new \ReflectionObject($res); - $fetchContentType = $reflector->getMethod('fetchContentType'); - $fetchContentType->setAccessible(true); - - $this->assertTrue($fetchContentType->invoke($res, array('Content-Type: application/json'))); - $this->assertFalse($fetchContentType->invoke($res, array('X-Some-Header: whateverValue'))); - } - - public function testCanHandleHttp301PermanentRedirect() - { - $res = new FileGetContents(); - - $res->retrieve('http://asyncapi.com/definitions/2.0.0/asyncapi.json'); - - $this->assertSame('application/schema+json', $res->getContentType()); - } + $res = new FileGetContents(); + + $res->retrieve('http://asyncapi.com/definitions/2.0.0/asyncapi.json'); + + $this->assertSame('application/schema+json', $res->getContentType()); } }