Skip to content

Commit 4f0e8f2

Browse files
committed
style: Correct code style violations
1 parent 4479f6e commit 4f0e8f2

File tree

1 file changed

+41
-42
lines changed

1 file changed

+41
-42
lines changed
+41-42
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,49 @@
11
<?php
22

3-
namespace JsonSchema\Tests\Uri\Retrievers
4-
{
5-
use JsonSchema\Uri\Retrievers\FileGetContents;
6-
use PHPUnit\Framework\TestCase;
3+
namespace JsonSchema\Tests\Uri\Retrievers;
4+
5+
use JsonSchema\Uri\Retrievers\FileGetContents;
6+
use PHPUnit\Framework\TestCase;
77

8+
/**
9+
* @group FileGetContents
10+
*/
11+
class FileGetContentsTest extends TestCase
12+
{
813
/**
9-
* @group FileGetContents
14+
* @expectedException \JsonSchema\Exception\ResourceNotFoundException
1015
*/
11-
class FileGetContentsTest extends TestCase
16+
public function testFetchMissingFile()
17+
{
18+
$res = new FileGetContents();
19+
$res->retrieve(__DIR__ . '/Fixture/missing.json');
20+
}
21+
22+
public function testFetchFile()
23+
{
24+
$res = new FileGetContents();
25+
$result = $res->retrieve(__DIR__ . '/../Fixture/child.json');
26+
$this->assertNotEmpty($result);
27+
}
28+
29+
public function testContentType()
30+
{
31+
$res = new FileGetContents();
32+
33+
$reflector = new \ReflectionObject($res);
34+
$fetchContentType = $reflector->getMethod('fetchContentType');
35+
$fetchContentType->setAccessible(true);
36+
37+
$this->assertTrue($fetchContentType->invoke($res, array('Content-Type: application/json')));
38+
$this->assertFalse($fetchContentType->invoke($res, array('X-Some-Header: whateverValue')));
39+
}
40+
41+
public function testCanHandleHttp301PermanentRedirect()
1242
{
13-
/**
14-
* @expectedException \JsonSchema\Exception\ResourceNotFoundException
15-
*/
16-
public function testFetchMissingFile()
17-
{
18-
$res = new FileGetContents();
19-
$res->retrieve(__DIR__ . '/Fixture/missing.json');
20-
}
21-
22-
public function testFetchFile()
23-
{
24-
$res = new FileGetContents();
25-
$result = $res->retrieve(__DIR__ . '/../Fixture/child.json');
26-
$this->assertNotEmpty($result);
27-
}
28-
29-
public function testContentType()
30-
{
31-
$res = new FileGetContents();
32-
33-
$reflector = new \ReflectionObject($res);
34-
$fetchContentType = $reflector->getMethod('fetchContentType');
35-
$fetchContentType->setAccessible(true);
36-
37-
$this->assertTrue($fetchContentType->invoke($res, array('Content-Type: application/json')));
38-
$this->assertFalse($fetchContentType->invoke($res, array('X-Some-Header: whateverValue')));
39-
}
40-
41-
public function testCanHandleHttp301PermanentRedirect()
42-
{
43-
$res = new FileGetContents();
44-
45-
$res->retrieve('http://asyncapi.com/definitions/2.0.0/asyncapi.json');
46-
47-
$this->assertSame('application/schema+json', $res->getContentType());
48-
}
43+
$res = new FileGetContents();
44+
45+
$res->retrieve('http://asyncapi.com/definitions/2.0.0/asyncapi.json');
46+
47+
$this->assertSame('application/schema+json', $res->getContentType());
4948
}
5049
}

0 commit comments

Comments
 (0)