Browse Source

remove deprecation warnings

saeid 7 years ago
parent
commit
05f2ce45f0

+ 0 - 4
src/Controller/Controller.php

@@ -103,8 +103,6 @@ class Controller implements EventListenerInterface, EventDispatcherInterface
      * This object contains all the information about a request and several methods for reading
      * additional information about the request.
      *
-     * Deprecated 3.6.0: The property will become protected in 4.0.0. Use getRequest()/setRequest instead.
-     *
      * @var \Cake\Http\ServerRequest
      * @link https://book.cakephp.org/3.0/en/controllers/request-response.html#request
      */
@@ -113,8 +111,6 @@ class Controller implements EventListenerInterface, EventDispatcherInterface
     /**
      * An instance of a Response object that contains information about the impending response
      *
-     * Deprecated 3.6.0: The property will become protected in 4.0.0. Use getResponse()/setResponse instead.
-
      * @var \Cake\Http\Response
      * @link https://book.cakephp.org/3.0/en/controllers/request-response.html#response
      */

+ 0 - 15
src/Filesystem/Folder.php

@@ -352,21 +352,6 @@ class Folder
     /**
      * Returns a correct set of slashes for given $path. (\\ for Windows paths and / for other paths.)
      *
-     * @param string $path Path to check
-     * @return string Set of slashes ("\\" or "/")
-     *
-     * @deprecated 3.7.0 This method will be removed in 4.0.0. Use correctSlashFor() instead.
-     */
-    public static function normalizePath($path)
-    {
-        deprecationWarning('Folder::normalizePath() is deprecated. Use Folder::correctSlashFor() instead.');
-
-        return Folder::correctSlashFor($path);
-    }
-
-    /**
-     * Returns a correct set of slashes for given $path. (\\ for Windows paths and / for other paths.)
-     *
      * @param string $path Path to transform
      * @return string Path with the correct set of slashes ("\\" or "/")
      */

+ 0 - 4
src/Http/Session.php

@@ -255,10 +255,6 @@ class Session
         $className = App::className($class, 'Http/Session');
 
         if (!$className) {
-            deprecationWarning('Session adapters should be moved to the Http/Session namespace.');
-            $className = App::className($class, 'Network/Session');
-        }
-        if (!$className) {
             throw new InvalidArgumentException(
                 sprintf('The class "%s" does not exist and cannot be used as a session engine', $class)
             );

+ 0 - 6
tests/TestCase/BasicsTest.php

@@ -160,12 +160,6 @@ class BasicsTest extends TestCase
         $result = h($string, false);
         $this->assertEquals('<foo> &  ', $result);
 
-        $this->deprecated(function () {
-            $string = '<foo> & &nbsp;';
-            $result = h($string, 'UTF-8');
-            $this->assertEquals('&lt;foo&gt; &amp; &amp;nbsp;', $result);
-        });
-
         $string = "An invalid\x80string";
         $result = h($string);
         $this->assertContains('string', $result);

+ 0 - 15
tests/TestCase/Controller/ControllerTest.php

@@ -1042,21 +1042,6 @@ class ControllerTest extends TestCase
     }
 
     /**
-     * 4.x
-     * Test declared deprecated properties like $theme are now NULL
-     *
-     * @return void
-     */
-    public function testDeclaredDeprecatedProperty()
-    {
-        $controller = new TestController(new ServerRequest(), new Response());
-
-        // @codingStandardsIgnoreStart
-        $this->assertNull( @$controller->createView()->theme);
-        // @codingStandardsIgnoreEnd
-    }
-
-    /**
      * Test that view variables are being set after the beforeRender event gets dispatched
      *
      * @return void

+ 11 - 13
tests/TestCase/Core/InstanceConfigTraitTest.php

@@ -103,19 +103,17 @@ class InstanceConfigTraitTest extends TestCase
      */
     public function testDefaultsAreSet()
     {
-        $this->deprecated(function () {
-            $this->assertSame(
-                [
-                    'some' => 'string',
-                    'a' => [
-                        'nested' => 'value',
-                        'other' => 'value'
-                    ]
-                ],
-                $this->object->getConfig(),
-                'runtime config should match the defaults if not overridden'
-            );
-        });
+        $this->assertSame(
+            [
+                'some' => 'string',
+                'a' => [
+                    'nested' => 'value',
+                    'other' => 'value'
+                ]
+            ],
+            $this->object->getConfig(),
+            'runtime config should match the defaults if not overridden'
+        );
     }
 
     /**

+ 0 - 1
tests/TestCase/Core/StaticConfigTraitTest.php

@@ -30,7 +30,6 @@ class TestCacheStaticConfig
      * @var array
      */
     protected static $_dsnClassMap = [
-        'apc' => 'Cake\Cache\Engine\ApcuEngine', // @deprecated in 3.6. Use apcu instead.
         'apcu' => 'Cake\Cache\Engine\ApcuEngine',
         'file' => 'Cake\Cache\Engine\FileEngine',
         'memcached' => 'Cake\Cache\Engine\MemcachedEngine',

+ 7 - 9
tests/TestCase/Event/EventManagerTest.php

@@ -104,15 +104,13 @@ class EventManagerTest extends TestCase
      */
     public function testAttachListener()
     {
-        $this->deprecated(function () {
-            $manager = new EventManager();
-            $listener = new CustomTestEventListenerInterface();
-            $manager->on($listener);
-            $expected = [
-                ['callable' => [$listener, 'listenerFunction']],
-            ];
-            $this->assertEquals($expected, $manager->listeners('fake.event'));
-        });
+        $manager = new EventManager();
+        $listener = new CustomTestEventListenerInterface();
+        $manager->on($listener);
+        $expected = [
+            ['callable' => [$listener, 'listenerFunction']],
+        ];
+        $this->assertEquals($expected, $manager->listeners('fake.event'));
     }
 
     /**

+ 0 - 23
tests/TestCase/Filesystem/FolderTest.php

@@ -682,29 +682,6 @@ class FolderTest extends TestCase
     }
 
     /**
-     * testNormalizePath method
-     *
-     * @group deprecated
-     * @return void
-     */
-    public function testNormalizePath()
-    {
-        $this->deprecated(function () {
-            $path = '/path/to/file';
-            $result = Folder::normalizePath($path);
-            $this->assertEquals('/', $result);
-
-            $path = '\\path\\\to\\\file';
-            $result = Folder::normalizePath($path);
-            $this->assertEquals('/', $result);
-
-            $path = 'C:\\path\\to\\file';
-            $result = Folder::normalizePath($path);
-            $this->assertEquals('\\', $result);
-        });
-    }
-
-    /**
      * testNormalizeFullPath method
      *
      * @return void

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

@@ -3182,7 +3182,7 @@ XML;
     }
 
     /**
-     * Test that withoutAttribute() cannot remove deprecated public properties.
+     * Test that withoutAttribute() cannot remove emulatedAttributes properties.
      *
      * @dataProvider emulatedPropertyProvider
      * @return void

+ 4 - 7
tests/TestCase/Http/SessionTest.php

@@ -534,13 +534,10 @@ class SessionTest extends TestCase
      */
     public function testBadEngine()
     {
-        // Not actually deprecated, but we need to supress the deprecation warning.
-        $this->deprecated(function () {
-            $this->expectException(\InvalidArgumentException::class);
-            $this->expectExceptionMessage('The class "Derp" does not exist and cannot be used as a session engine');
-            $session = new Session();
-            $session->engine('Derp');
-        });
+        $this->expectException(\InvalidArgumentException::class);
+        $this->expectExceptionMessage('The class "Derp" does not exist and cannot be used as a session engine');
+        $session = new Session();
+        $session->engine('Derp');
     }
 
     /**

+ 0 - 1
tests/TestCase/View/Helper/FormHelperTest.php

@@ -9072,7 +9072,6 @@ class FormHelperTest extends TestCase
      *
      * Test the `nestedInput` parameter
      *
-     * @group deprecated
      * @return void
      */
     public function testNestedLabelInput()

+ 0 - 1
tests/TestCase/View/ViewBuilderTest.php

@@ -89,7 +89,6 @@ class ViewBuilderTest extends TestCase
     /**
      * Test string property accessor/mutator methods.
      *
-     * @deprecated
      * @dataProvider boolPropertyProvider
      * @return void
      */