Completed
Pull Request — master (#51)
by
unknown
20s
created
tests/Base/PHPUnit5.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -2,13 +2,13 @@
 block discarded – undo
2 2
 
3 3
 class Base_PHPUnit5 extends PHPUnit_Framework_TestCase
4 4
 {
5
-    /**
6
-     * @param string $exception
7
-     * @param string $message
8
-     * @return void
9
-     */
10
-    public function expectException($exception, $message = '')
11
-    {
12
-        parent::setExpectedException($exception, $message);
13
-    }
5
+	/**
6
+	 * @param string $exception
7
+	 * @param string $message
8
+	 * @return void
9
+	 */
10
+	public function expectException($exception, $message = '')
11
+	{
12
+		parent::setExpectedException($exception, $message);
13
+	}
14 14
 }
Please login to merge, or discard this patch.
tests/Base/PHPUnit6.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -2,16 +2,16 @@
 block discarded – undo
2 2
 
3 3
 class Base_PHPUnit6 extends PHPUnit\Framework\TestCase
4 4
 {
5
-    /**
6
-     * @param string $exception
7
-     * @param string $message
8
-     * @return void
9
-     */
10
-    public function expectException($exception, $message = '')
11
-    {
12
-        parent::expectException($exception);
13
-        if ($message !== '') {
14
-            parent::expectExceptionMessage($message);
15
-        }
16
-    }
5
+	/**
6
+	 * @param string $exception
7
+	 * @param string $message
8
+	 * @return void
9
+	 */
10
+	public function expectException($exception, $message = '')
11
+	{
12
+		parent::expectException($exception);
13
+		if ($message !== '') {
14
+			parent::expectExceptionMessage($message);
15
+		}
16
+	}
17 17
 }
Please login to merge, or discard this patch.
tests/StatementTest.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -3,29 +3,29 @@
 block discarded – undo
3 3
 class StatementTest extends SwaggerGen_TestCase
4 4
 {
5 5
 
6
-    /**
7
-     * @covers \SwaggerGen\Statement::__construct
8
-     */
9
-    public function testConstructor()
10
-    {
11
-        $object = new \SwaggerGen\Statement('command', 'some data');
6
+	/**
7
+	 * @covers \SwaggerGen\Statement::__construct
8
+	 */
9
+	public function testConstructor()
10
+	{
11
+		$object = new \SwaggerGen\Statement('command', 'some data');
12 12
 
13
-        $this->assertInstanceOf('\SwaggerGen\Statement', $object);
14
-        $this->assertSame('command', $object->getCommand());
15
-        $this->assertSame('some data', $object->getData());
16
-    }
13
+		$this->assertInstanceOf('\SwaggerGen\Statement', $object);
14
+		$this->assertSame('command', $object->getCommand());
15
+		$this->assertSame('some data', $object->getData());
16
+	}
17 17
 
18
-    /**
19
-     * @covers \SwaggerGen\Statement::__construct
20
-     */
21
-    public function testConstructor_File()
22
-    {
23
-        $object = new \SwaggerGen\Statement('command', 'some data', 'file', 123);
24
-        $this->assertInstanceOf('\SwaggerGen\Statement', $object);
18
+	/**
19
+	 * @covers \SwaggerGen\Statement::__construct
20
+	 */
21
+	public function testConstructor_File()
22
+	{
23
+		$object = new \SwaggerGen\Statement('command', 'some data', 'file', 123);
24
+		$this->assertInstanceOf('\SwaggerGen\Statement', $object);
25 25
 
26
-        $this->assertSame('command', $object->getCommand());
27
-        $this->assertSame('some data', $object->getData());
28
-        $this->assertSame('file', $object->getFile());
29
-        $this->assertSame(123, $object->getLine());
30
-    }
26
+		$this->assertSame('command', $object->getCommand());
27
+		$this->assertSame('some data', $object->getData());
28
+		$this->assertSame('file', $object->getFile());
29
+		$this->assertSame(123, $object->getLine());
30
+	}
31 31
 }
Please login to merge, or discard this patch.
tests/bootstrap.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 spl_autoload_register(function ($classname) {
4
-    $file = dirname(__DIR__) . DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $classname) . '.php';
5
-    if (is_file($file)) {
6
-        require_once $file;
7
-    }
4
+	$file = dirname(__DIR__) . DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $classname) . '.php';
5
+	if (is_file($file)) {
6
+		require_once $file;
7
+	}
8 8
 });
9 9
 
10 10
 
@@ -16,20 +16,20 @@  discard block
 block discarded – undo
16 16
 // inbetween there was `expectException()` without type hint
17 17
 
18 18
 if (class_exists('PHPUnit\Runner\Version')) {
19
-    $version = PHPUnit\Runner\Version::id();
19
+	$version = PHPUnit\Runner\Version::id();
20 20
 } else if (class_exists('PHPUnit_Runner_Version')) {
21
-    $version = PHPUnit_Runner_Version::id();
21
+	$version = PHPUnit_Runner_Version::id();
22 22
 } else {
23
-    throw new Exception('Cannot detect PHPUnit version');
23
+	throw new Exception('Cannot detect PHPUnit version');
24 24
 }
25 25
 
26 26
 if (version_compare($version, '7.0.0', '>=')) {
27
-    require dirname(__FILE__) . '/Base/PHPUnit7.php';
28
-    class_alias('Base_PHPUnit7', 'SwaggerGen_TestCase');
27
+	require dirname(__FILE__) . '/Base/PHPUnit7.php';
28
+	class_alias('Base_PHPUnit7', 'SwaggerGen_TestCase');
29 29
 } else if (version_compare($version, '6.0.0', '>=')) {
30
-    require dirname(__FILE__) . '/Base/PHPUnit6.php';
31
-    class_alias('Base_PHPUnit6', 'SwaggerGen_TestCase');
30
+	require dirname(__FILE__) . '/Base/PHPUnit6.php';
31
+	class_alias('Base_PHPUnit6', 'SwaggerGen_TestCase');
32 32
 } else {
33
-    require dirname(__FILE__) . '/Base/PHPUnit5.php';
34
-    class_alias('Base_PHPUnit5', 'SwaggerGen_TestCase');
33
+	require dirname(__FILE__) . '/Base/PHPUnit5.php';
34
+	class_alias('Base_PHPUnit5', 'SwaggerGen_TestCase');
35 35
 }
Please login to merge, or discard this patch.
tests/output/OutputTest.php 1 patch
Indentation   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -3,57 +3,57 @@
 block discarded – undo
3 3
 class OutputTest extends SwaggerGen_TestCase
4 4
 {
5 5
 
6
-    /**
7
-     * @covers       \SwaggerGen\Exception::__construct
8
-     * @dataProvider provideAllCases
9
-     */
10
-    public function testAllCases($name, $files, $expected)
11
-    {
12
-        $SwaggerGen = new \SwaggerGen\SwaggerGen('example.com', '/base');
13
-        $actual = $SwaggerGen->getSwagger($files, array(), \SwaggerGen\SwaggerGen::FORMAT_JSON);
14
-        $this->assertJsonStringEqualsJsonString($expected, $this->normalizeJson($actual), $name);
15
-    }
16
-
17
-    /**
18
-     * Normalizes and pretty-prints json (whitespace mostly)
19
-     *
20
-     * This is useful to get better diff results when assertions fail.
21
-     *
22
-     * @param string $json
23
-     * @return string
24
-     */
25
-    private function normalizeJson($json)
26
-    {
27
-        return json_encode(
28
-            json_decode($json),
29
-            PHP_VERSION_ID >= 50400 ? constant('JSON_PRETTY_PRINT') : 0
30
-        );
31
-    }
32
-
33
-    public function provideAllCases()
34
-    {
35
-        $cases = array();
36
-
37
-        foreach (glob(__DIR__ . '/*', GLOB_ONLYDIR) as $dir) {
38
-            $path = realpath($dir);
39
-            $json = $this->normalizeJson(file_get_contents($path . '/expected.json'));
40
-
41
-            $files = array();
42
-            if (file_exists($path . '/source.php')) {
43
-                $files[] = $path . '/source.php';
44
-            }
45
-            if (file_exists($path . '/source.txt')) {
46
-                $files[] = $path . '/source.txt';
47
-            }
48
-
49
-            $cases[] = array(
50
-                basename($dir),
51
-                $files,
52
-                $json
53
-            );
54
-        }
55
-
56
-        return $cases;
57
-    }
6
+	/**
7
+	 * @covers       \SwaggerGen\Exception::__construct
8
+	 * @dataProvider provideAllCases
9
+	 */
10
+	public function testAllCases($name, $files, $expected)
11
+	{
12
+		$SwaggerGen = new \SwaggerGen\SwaggerGen('example.com', '/base');
13
+		$actual = $SwaggerGen->getSwagger($files, array(), \SwaggerGen\SwaggerGen::FORMAT_JSON);
14
+		$this->assertJsonStringEqualsJsonString($expected, $this->normalizeJson($actual), $name);
15
+	}
16
+
17
+	/**
18
+	 * Normalizes and pretty-prints json (whitespace mostly)
19
+	 *
20
+	 * This is useful to get better diff results when assertions fail.
21
+	 *
22
+	 * @param string $json
23
+	 * @return string
24
+	 */
25
+	private function normalizeJson($json)
26
+	{
27
+		return json_encode(
28
+			json_decode($json),
29
+			PHP_VERSION_ID >= 50400 ? constant('JSON_PRETTY_PRINT') : 0
30
+		);
31
+	}
32
+
33
+	public function provideAllCases()
34
+	{
35
+		$cases = array();
36
+
37
+		foreach (glob(__DIR__ . '/*', GLOB_ONLYDIR) as $dir) {
38
+			$path = realpath($dir);
39
+			$json = $this->normalizeJson(file_get_contents($path . '/expected.json'));
40
+
41
+			$files = array();
42
+			if (file_exists($path . '/source.php')) {
43
+				$files[] = $path . '/source.php';
44
+			}
45
+			if (file_exists($path . '/source.txt')) {
46
+				$files[] = $path . '/source.txt';
47
+			}
48
+
49
+			$cases[] = array(
50
+				basename($dir),
51
+				$files,
52
+				$json
53
+			);
54
+		}
55
+
56
+		return $cases;
57
+	}
58 58
 
59 59
 }
Please login to merge, or discard this patch.
tests/output/uuid model overwrite/source.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -13,14 +13,14 @@
 block discarded – undo
13 13
 class Example
14 14
 {
15 15
 
16
-    /**
17
-     * @rest\endpoint /endpoint
18
-     * @rest\method GET Something
19
-     * @rest\response 200 uuid
20
-     */
21
-    public function Dummy()
22
-    {
16
+	/**
17
+	 * @rest\endpoint /endpoint
18
+	 * @rest\method GET Something
19
+	 * @rest\response 200 uuid
20
+	 */
21
+	public function Dummy()
22
+	{
23 23
 
24
-    }
24
+	}
25 25
 
26 26
 }
Please login to merge, or discard this patch.
tests/output/global parameter/source.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -11,15 +11,15 @@
 block discarded – undo
11 11
 class Example
12 12
 {
13 13
 
14
-    /**
15
-     * @rest\endpoint /endpoint/{listid}
16
-     * @rest\method GET Something
17
-     * @rest\param listid
18
-     * @rest\response 200
19
-     */
20
-    public function Dummy()
21
-    {
14
+	/**
15
+	 * @rest\endpoint /endpoint/{listid}
16
+	 * @rest\method GET Something
17
+	 * @rest\param listid
18
+	 * @rest\response 200
19
+	 */
20
+	public function Dummy()
21
+	{
22 22
 
23
-    }
23
+	}
24 24
 
25 25
 }
Please login to merge, or discard this patch.
tests/output/preprocessor replace/source.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -11,17 +11,17 @@
 block discarded – undo
11 11
 class Example
12 12
 {
13 13
 
14
-    /**
15
-     * @rest\endpoint /endpoint/{listid}
16
-     * @rest\method GET Something
17
-     * @rest\ifndef skip
18
-     * @rest\param listid
19
-     * @rest\endif
20
-     * @rest\response 200
21
-     */
22
-    public function Dummy()
23
-    {
14
+	/**
15
+	 * @rest\endpoint /endpoint/{listid}
16
+	 * @rest\method GET Something
17
+	 * @rest\ifndef skip
18
+	 * @rest\param listid
19
+	 * @rest\endif
20
+	 * @rest\response 200
21
+	 */
22
+	public function Dummy()
23
+	{
24 24
 
25
-    }
25
+	}
26 26
 
27 27
 }
Please login to merge, or discard this patch.
tests/output/docblock comment in method/source.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -13,17 +13,17 @@
 block discarded – undo
13 13
 class Example
14 14
 {
15 15
 
16
-    public function Dummy()
17
-    {
18
-        /**
19
-         * @rest\endpoint /v1/users/{id}
20
-         * @rest\method GET Return a JSON with all the user attributes
21
-         * @rest\path Int id The ID of the User
22
-         * @rest\response 200 User
23
-         */
24
-        $app->get('/v1/users/{id:[0-9]+}', function ($request, $response, $args) {
25
-            // ...
26
-        });
27
-    }
16
+	public function Dummy()
17
+	{
18
+		/**
19
+		 * @rest\endpoint /v1/users/{id}
20
+		 * @rest\method GET Return a JSON with all the user attributes
21
+		 * @rest\path Int id The ID of the User
22
+		 * @rest\response 200 User
23
+		 */
24
+		$app->get('/v1/users/{id:[0-9]+}', function ($request, $response, $args) {
25
+			// ...
26
+		});
27
+	}
28 28
 
29 29
 }
Please login to merge, or discard this patch.