Test Failed
Pull Request — master (#1190)
by butschster
10:27
created
src/Core/tests/SingletonsTest.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -181,7 +181,9 @@  discard block
 block discarded – undo
181 181
     public function testHasShouldReturnTrueWhenSingletonIsAlreadyConstructed(): void
182 182
     {
183 183
         $container = new Container();
184
-        $class = new #[Singleton] class {};
184
+        $class = new #[Singleton] class
185
+        {
186
+};
185 187
 
186 188
         self::assertFalse($container->has($class::class));
187 189
 
@@ -194,7 +196,8 @@  discard block
 block discarded – undo
194 196
     {
195 197
         return new
196 198
         #[Singleton]
197
-        class {
199
+        class
200
+        {
198 201
             public string $baz = 'baz';
199 202
         };
200 203
     }
Please login to merge, or discard this patch.
src/Tokenizer/tests/Bootloader/TokenizerListenerBootloaderTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
         $kernel = TestCoreWithTokenizer::create(directories: ['root' => __DIR__], container: $container);
58 58
         $kernel->run();
59 59
 
60
-        self::assertContains(\dirname(__DIR__) . '/Fixtures/Bootloader', $container->get(TokenizerConfig::class)->getDirectories());
60
+        self::assertContains(\dirname(__DIR__).'/Fixtures/Bootloader', $container->get(TokenizerConfig::class)->getDirectories());
61 61
     }
62 62
 
63 63
 }
Please login to merge, or discard this patch.
src/Tokenizer/tests/Attribute/TargetAttributeTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,10 +20,10 @@
 block discarded – undo
20 20
     public function testToString(): void
21 21
     {
22 22
         $attribute = new TargetAttribute('foo');
23
-        self::assertSame('3dc18b19eed74479a03c069dec2e8724', (string) $attribute);
23
+        self::assertSame('3dc18b19eed74479a03c069dec2e8724', (string)$attribute);
24 24
 
25 25
         $attribute = new TargetAttribute('foo', 'bar');
26
-        self::assertSame('52ec767c53f3898bf6de6f6e88125dc8', (string) $attribute);
26
+        self::assertSame('52ec767c53f3898bf6de6f6e88125dc8', (string)$attribute);
27 27
     }
28 28
 
29 29
     public function testFilterAttrWithArgs(): void
Please login to merge, or discard this patch.
src/Tokenizer/tests/Attribute/TargetClassTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,9 +12,9 @@
 block discarded – undo
12 12
     public function testToString(): void
13 13
     {
14 14
         $attribute = new TargetClass('foo');
15
-        self::assertSame('3319d33aad20ad375d27dcd03c879454', (string) $attribute);
15
+        self::assertSame('3319d33aad20ad375d27dcd03c879454', (string)$attribute);
16 16
 
17 17
         $attribute = new TargetClass('foo', 'bar');
18
-        self::assertSame('a95c8a2cfc901290939df93183ce98d6', (string) $attribute);
18
+        self::assertSame('a95c8a2cfc901290939df93183ce98d6', (string)$attribute);
19 19
     }
20 20
 }
21 21
\ No newline at end of file
Please login to merge, or discard this patch.
src/AuthHttp/tests/Middleware/Firewall/OverwriteFirewallTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,6 +33,6 @@
 block discarded – undo
33 33
             new ServerRequest('GET', new Uri('/admin'), ['X-Auth-Token' => $token], 'php://input')
34 34
         );
35 35
 
36
-        self::assertSame($token === 'ok' ? '/admin' : '/login', (string) $response->getBody());
36
+        self::assertSame($token === 'ok' ? '/admin' : '/login', (string)$response->getBody());
37 37
     }
38 38
 }
Please login to merge, or discard this patch.
src/AuthHttp/tests/Middleware/Firewall/RedirectFirewallTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 
58 58
         self::assertSame(302, $response->getStatusCode());
59 59
         self::assertSame(['Location' => ['/login']], $response->getHeaders());
60
-        self::assertSame('', (string) $response->getBody());
60
+        self::assertSame('', (string)$response->getBody());
61 61
     }
62 62
 
63 63
     #[DataProvider('failTokensDataProvider')]
@@ -80,6 +80,6 @@  discard block
 block discarded – undo
80 80
 
81 81
         self::assertSame(301, $response->getStatusCode());
82 82
         self::assertSame(['Location' => ['/login']], $response->getHeaders());
83
-        self::assertSame('', (string) $response->getBody());
83
+        self::assertSame('', (string)$response->getBody());
84 84
     }
85 85
 }
Please login to merge, or discard this patch.
src/AuthHttp/tests/Middleware/Firewall/ExceptionFirewallTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
         $response = $http->handle(new ServerRequest('GET', '', ['X-Auth-Token' => $token], 'php://input'));
33 33
 
34
-        self::assertSame('OK', (string) $response->getBody());
34
+        self::assertSame('OK', (string)$response->getBody());
35 35
     }
36 36
 
37 37
     #[DataProvider('failTokensDataProvider')]
@@ -51,6 +51,6 @@  discard block
 block discarded – undo
51 51
         $this->expectException(AuthException::class);
52 52
         $response = $http->handle(new ServerRequest('GET', '', ['X-Auth-Token' => $token], 'php://input'));
53 53
 
54
-        self::assertSame('OK', (string) $response->getBody());
54
+        self::assertSame('OK', (string)$response->getBody());
55 55
     }
56 56
 }
Please login to merge, or discard this patch.
src/Streams/tests/StreamsTest.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 
11 11
 class StreamsTest extends TestCase
12 12
 {
13
-    private const FIXTURE_DIRECTORY = __DIR__ . '/fixtures';
13
+    private const FIXTURE_DIRECTORY = __DIR__.'/fixtures';
14 14
 
15 15
     public function setUp(): void
16 16
     {
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
         self::assertSame(strlen('sample text'), filesize($filename));
36 36
         self::assertSame(md5('sample text'), md5_file($filename));
37 37
 
38
-        $newFilename = self::FIXTURE_DIRECTORY . '/test.txt';
38
+        $newFilename = self::FIXTURE_DIRECTORY.'/test.txt';
39 39
         copy($filename, $newFilename);
40 40
 
41 41
         self::assertFileExists($newFilename);
@@ -76,15 +76,15 @@  discard block
 block discarded – undo
76 76
      */
77 77
     public function testException(): void
78 78
     {
79
-        try {
79
+        try{
80 80
             fopen('spiral://non-exists', 'rb');
81
-        } catch (\Throwable $e) {
81
+        }catch (\Throwable $e){
82 82
             self::assertStringContainsString('failed to open stream', $e->getMessage());
83 83
         }
84 84
 
85
-        try {
85
+        try{
86 86
             filemtime('spiral://non-exists');
87
-        } catch (\Throwable $e) {
87
+        }catch (\Throwable $e){
88 88
             self::assertStringContainsString('stat failed', $e->getMessage());
89 89
         }
90 90
     }
@@ -94,15 +94,15 @@  discard block
 block discarded – undo
94 94
      */
95 95
     public function testExceptionPHP8(): void
96 96
     {
97
-        try {
97
+        try{
98 98
             fopen('spiral://non-exists', 'rb');
99
-        } catch (\Throwable $e) {
99
+        }catch (\Throwable $e){
100 100
             self::assertStringContainsString('Failed to open stream', $e->getMessage());
101 101
         }
102 102
 
103
-        try {
103
+        try{
104 104
             filemtime('spiral://non-exists');
105
-        } catch (\Throwable $e) {
105
+        }catch (\Throwable $e){
106 106
             self::assertStringContainsString('stat failed', $e->getMessage());
107 107
         }
108 108
     }
Please login to merge, or discard this patch.
Braces   +20 added lines, -8 removed lines patch added patch discarded remove patch
@@ -76,15 +76,21 @@  discard block
 block discarded – undo
76 76
      */
77 77
     public function testException(): void
78 78
     {
79
-        try {
79
+        try
80
+        {
80 81
             fopen('spiral://non-exists', 'rb');
81
-        } catch (\Throwable $e) {
82
+        }
83
+        catch (\Throwable $e)
84
+        {
82 85
             self::assertStringContainsString('failed to open stream', $e->getMessage());
83 86
         }
84 87
 
85
-        try {
88
+        try
89
+        {
86 90
             filemtime('spiral://non-exists');
87
-        } catch (\Throwable $e) {
91
+        }
92
+        catch (\Throwable $e)
93
+        {
88 94
             self::assertStringContainsString('stat failed', $e->getMessage());
89 95
         }
90 96
     }
@@ -94,15 +100,21 @@  discard block
 block discarded – undo
94 100
      */
95 101
     public function testExceptionPHP8(): void
96 102
     {
97
-        try {
103
+        try
104
+        {
98 105
             fopen('spiral://non-exists', 'rb');
99
-        } catch (\Throwable $e) {
106
+        }
107
+        catch (\Throwable $e)
108
+        {
100 109
             self::assertStringContainsString('Failed to open stream', $e->getMessage());
101 110
         }
102 111
 
103
-        try {
112
+        try
113
+        {
104 114
             filemtime('spiral://non-exists');
105
-        } catch (\Throwable $e) {
115
+        }
116
+        catch (\Throwable $e)
117
+        {
106 118
             self::assertStringContainsString('stat failed', $e->getMessage());
107 119
         }
108 120
     }
Please login to merge, or discard this patch.
src/Http/tests/AcceptHeaderItemTest.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
     public static function emptyItemProvider(): iterable
22 22
     {
23 23
         $values = ['', ' '];
24
-        foreach ($values as $value) {
24
+        foreach ($values as $value){
25 25
             yield from [
26 26
                 [AcceptHeaderItem::fromString($value)],
27 27
                 [new AcceptHeaderItem($value)],
@@ -58,11 +58,11 @@  discard block
 block discarded – undo
58 58
     #[DataProvider('qualityBoundariesProvider')]
59 59
     public function testItemQualityBoundaries(float $quality, AcceptHeaderItem $item): void
60 60
     {
61
-        if ($quality > 1) {
61
+        if ($quality > 1){
62 62
             self::assertEqualsWithDelta(1.0, $item->getQuality(), PHP_FLOAT_EPSILON);
63 63
         }
64 64
 
65
-        if ($quality < 0) {
65
+        if ($quality < 0){
66 66
             self::assertEqualsWithDelta(0.0, $item->getQuality(), PHP_FLOAT_EPSILON);
67 67
         }
68 68
 
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
     public static function qualityBoundariesProvider(): iterable
74 74
     {
75 75
         $qualities = [-1, 0, 0.5, 1, 2];
76
-        foreach ($qualities as $quality) {
76
+        foreach ($qualities as $quality){
77 77
             yield from [
78 78
                 [$quality, AcceptHeaderItem::fromString("*;q=$quality")],
79 79
                 [$quality, AcceptHeaderItem::fromString("*;Q=$quality")],
@@ -106,9 +106,9 @@  discard block
 block discarded – undo
106 106
             ]
107 107
         ];
108 108
 
109
-        foreach ($set as $params) {
109
+        foreach ($set as $params){
110 110
             $formattedParams = [];
111
-            foreach ($params['passed'] as $k => $v) {
111
+            foreach ($params['passed'] as $k => $v){
112 112
                 $formattedParams[] = "$k=$v";
113 113
             }
114 114
 
Please login to merge, or discard this patch.
Braces   +12 added lines, -6 removed lines patch added patch discarded remove patch
@@ -21,7 +21,8 @@  discard block
 block discarded – undo
21 21
     public static function emptyItemProvider(): iterable
22 22
     {
23 23
         $values = ['', ' '];
24
-        foreach ($values as $value) {
24
+        foreach ($values as $value)
25
+        {
25 26
             yield from [
26 27
                 [AcceptHeaderItem::fromString($value)],
27 28
                 [new AcceptHeaderItem($value)],
@@ -58,11 +59,13 @@  discard block
 block discarded – undo
58 59
     #[DataProvider('qualityBoundariesProvider')]
59 60
     public function testItemQualityBoundaries(float $quality, AcceptHeaderItem $item): void
60 61
     {
61
-        if ($quality > 1) {
62
+        if ($quality > 1)
63
+        {
62 64
             self::assertEqualsWithDelta(1.0, $item->getQuality(), PHP_FLOAT_EPSILON);
63 65
         }
64 66
 
65
-        if ($quality < 0) {
67
+        if ($quality < 0)
68
+        {
66 69
             self::assertEqualsWithDelta(0.0, $item->getQuality(), PHP_FLOAT_EPSILON);
67 70
         }
68 71
 
@@ -73,7 +76,8 @@  discard block
 block discarded – undo
73 76
     public static function qualityBoundariesProvider(): iterable
74 77
     {
75 78
         $qualities = [-1, 0, 0.5, 1, 2];
76
-        foreach ($qualities as $quality) {
79
+        foreach ($qualities as $quality)
80
+        {
77 81
             yield from [
78 82
                 [$quality, AcceptHeaderItem::fromString("*;q=$quality")],
79 83
                 [$quality, AcceptHeaderItem::fromString("*;Q=$quality")],
@@ -106,9 +110,11 @@  discard block
 block discarded – undo
106 110
             ]
107 111
         ];
108 112
 
109
-        foreach ($set as $params) {
113
+        foreach ($set as $params)
114
+        {
110 115
             $formattedParams = [];
111
-            foreach ($params['passed'] as $k => $v) {
116
+            foreach ($params['passed'] as $k => $v)
117
+            {
112 118
                 $formattedParams[] = "$k=$v";
113 119
             }
114 120
 
Please login to merge, or discard this patch.