Browse Source

Remove compatibility test case and stub class.

Mark Story 7 years ago
parent
commit
0fb3414cb2

+ 1 - 1
src/Http/Client.php

@@ -179,7 +179,7 @@ class Client
     /**
      * Get the cookies stored in the Client.
      *
-     * @return \Cake\Http\Client\CookieCollection
+     * @return \Cake\Http\CookieCollection
      */
     public function cookies()
     {

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

@@ -418,48 +418,6 @@ class ClientTest extends TestCase
     }
 
     /**
-     * Test authentication adapter that mutates request.
-     *
-     * @group deprecated
-     * @return void
-     */
-    public function testAuthenticationWithMutation()
-    {
-        $this->deprecated(function () {
-            static::setAppNamespace();
-            $response = new Response();
-            $mock = $this->getMockBuilder('Cake\Http\Client\Adapter\Stream')
-                ->setMethods(['send'])
-                ->getMock();
-            $headers = [
-                'Authorization' => 'Bearer abc123',
-                'Proxy-Authorization' => 'Bearer abc123',
-            ];
-            $mock->expects($this->once())
-                ->method('send')
-                ->with($this->callback(function ($request) use ($headers) {
-                    $this->assertEquals(Request::METHOD_GET, $request->getMethod());
-                    $this->assertEquals('http://cakephp.org/', '' . $request->getUri());
-                    $this->assertEquals($headers['Authorization'], $request->getHeaderLine('Authorization'));
-                    $this->assertEquals($headers['Proxy-Authorization'], $request->getHeaderLine('Proxy-Authorization'));
-
-                    return true;
-                }))
-                ->will($this->returnValue([$response]));
-
-            $http = new Client([
-                'host' => 'cakephp.org',
-                'adapter' => $mock
-            ]);
-            $result = $http->get('/', [], [
-                'auth' => ['type' => 'TestApp\Http\CompatAuth'],
-                'proxy' => ['type' => 'TestApp\Http\CompatAuth'],
-            ]);
-            $this->assertSame($result, $response);
-        });
-    }
-
-    /**
      * Return a list of HTTP methods.
      *
      * @return array

+ 0 - 54
tests/test_app/TestApp/Http/CompatAuth.php

@@ -1,54 +0,0 @@
-<?php
-/**
- * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
- * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
- *
- * Licensed under The MIT License
- * Redistributions of files must retain the above copyright notice.
- *
- * @copyright     Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
- * @link          https://cakephp.org CakePHP(tm) Project
- * @since         3.3.0
- * @license       https://opensource.org/licenses/mit-license.php MIT License
- */
-namespace TestApp\Http;
-
-use Cake\Http\Client\Request;
-
-/**
- * Testing stub to ensure that auth providers
- * that mutate requests in place continue to work.
- *
- * @deprecated 3.3.0 Remove this compatibility behavior in 4.0.0
- */
-class CompatAuth
-{
-
-    /**
-     * Add Authorization header to the request via in-place mutation methods.
-     *
-     * @param \Cake\Http\Client\Request $request Request instance.
-     * @param array $credentials Credentials.
-     * @return \Cake\Http\Client\Request The updated request.
-     */
-    public function authentication(Request $request, array $credentials)
-    {
-        $request = $request->withHeader('Authorization', 'Bearer abc123');
-
-        return $request;
-    }
-
-    /**
-     * Proxy Authentication added via in-place mutation methods.
-     *
-     * @param \Cake\Http\Client\Request $request Request instance.
-     * @param array $credentials Credentials.
-     * @return \Cake\Http\Client\Request The updated request.
-     */
-    public function proxyAuthentication(Request $request, array $credentials)
-    {
-        $request = $request->withHeader('Proxy-Authorization', 'Bearer abc123');
-
-        return $request;
-    }
-}