Browse Source

Enable strict files for test files.

ADmad 7 years ago
parent
commit
77a2488bcd

+ 1 - 0
tests/TestCase/Http/ActionDispatcherTest.php

@@ -1,4 +1,5 @@
 <?php
+declare(strict_types=1);
 /**
  * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)

+ 1 - 0
tests/TestCase/Http/BaseApplicationTest.php

@@ -1,4 +1,5 @@
 <?php
+declare(strict_types=1);
 /**
  * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)

+ 1 - 0
tests/TestCase/Http/ClientTest.php

@@ -1,4 +1,5 @@
 <?php
+declare(strict_types=1);
 /**
  * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)

+ 1 - 0
tests/TestCase/Http/ControllerFactoryTest.php

@@ -1,4 +1,5 @@
 <?php
+declare(strict_types=1);
 /**
  * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)

+ 1 - 0
tests/TestCase/Http/Cookie/CookieCollectionTest.php

@@ -1,4 +1,5 @@
 <?php
+declare(strict_types=1);
 /**
  * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
  * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)

+ 1 - 0
tests/TestCase/Http/Cookie/CookieTest.php

@@ -1,4 +1,5 @@
 <?php
+declare(strict_types=1);
 /**
  * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
  * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)

+ 1 - 0
tests/TestCase/Http/CorsBuilderTest.php

@@ -1,4 +1,5 @@
 <?php
+declare(strict_types=1);
 namespace Cake\Test\TestCase\Http;
 
 use Cake\Http\CorsBuilder;

+ 1 - 0
tests/TestCase/Http/MiddlewareQueueTest.php

@@ -1,4 +1,5 @@
 <?php
+declare(strict_types=1);
 /**
  * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)

+ 1 - 0
tests/TestCase/Http/ResponseEmitterTest.php

@@ -1,4 +1,5 @@
 <?php
+declare(strict_types=1);
 /**
  * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)

+ 2 - 1
tests/TestCase/Http/ResponseTest.php

@@ -1,4 +1,5 @@
 <?php
+declare(strict_types=1);
 /**
  * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
@@ -1479,7 +1480,7 @@ class ResponseTest extends TestCase
         $this->assertNotSame($response, $newResponse);
 
         $response = new Response();
-        $newResponse = $response->withStringBody(1337);
+        $newResponse = $response->withStringBody('1337');
         $body = $newResponse->getBody();
         $this->assertSame('1337', (string)$body);
         $this->assertNotSame($response, $newResponse);

+ 1 - 0
tests/TestCase/Http/RunnerTest.php

@@ -1,4 +1,5 @@
 <?php
+declare(strict_types=1);
 /**
  * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)

+ 1 - 0
tests/TestCase/Http/ServerRequestFactoryTest.php

@@ -1,4 +1,5 @@
 <?php
+declare(strict_types=1);
 /**
  * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)

+ 1 - 6
tests/TestCase/Http/ServerRequestTest.php

@@ -1,4 +1,5 @@
 <?php
+declare(strict_types=1);
 /**
  * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
@@ -1069,9 +1070,6 @@ class ServerRequestTest extends TestCase
     {
         $request = new ServerRequest();
 
-        $request = $request->withEnv('HTTPS', 1);
-        $this->assertTrue($request->is('ssl'));
-
         $request = $request->withEnv('HTTPS', 'on');
         $this->assertTrue($request->is('ssl'));
 
@@ -1084,9 +1082,6 @@ class ServerRequestTest extends TestCase
         $request = $request->withEnv('HTTPS', 'off');
         $this->assertFalse($request->is('ssl'));
 
-        $request = $request->withEnv('HTTPS', false);
-        $this->assertFalse($request->is('ssl'));
-
         $request = $request->withEnv('HTTPS', '');
         $this->assertFalse($request->is('ssl'));
     }

+ 1 - 0
tests/TestCase/Http/ServerTest.php

@@ -1,4 +1,5 @@
 <?php
+declare(strict_types=1);
 /**
  * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)

+ 1 - 0
tests/TestCase/Http/Session/CacheSessionTest.php

@@ -1,4 +1,5 @@
 <?php
+declare(strict_types=1);
 /**
  * CacheSessionTest
  *

+ 1 - 0
tests/TestCase/Http/Session/DatabaseSessionTest.php

@@ -1,4 +1,5 @@
 <?php
+declare(strict_types=1);
 /**
  * DatabaseSessionTest file
  *

+ 1 - 0
tests/TestCase/Http/SessionTest.php

@@ -1,4 +1,5 @@
 <?php
+declare(strict_types=1);
 /**
  * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)

+ 1 - 0
tests/TestCase/Http/server_mocks.php

@@ -1,4 +1,5 @@
 <?php
+declare(strict_types=1);
 /**
  * A set of 'mocks' that replace the PHP global functions to aid testing.
  */