浏览代码

fix an error `Call to undefined method...`

fix an error `Call to undefined method
Cake\Http\Client\Request::header()`
saeid 7 年之前
父节点
当前提交
47392da94b
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      tests/test_app/TestApp/Http/CompatAuth.php

+ 6 - 2
tests/test_app/TestApp/Http/CompatAuth.php

@@ -33,7 +33,9 @@ class CompatAuth
      */
     public function authentication(Request $request, array $credentials)
     {
-        $request->header('Authorization', 'Bearer abc123');
+        $request = $request->withHeader('Authorization', 'Bearer abc123');
+
+        return $request;
     }
 
     /**
@@ -45,6 +47,8 @@ class CompatAuth
      */
     public function proxyAuthentication(Request $request, array $credentials)
     {
-        $request->header('Proxy-Authorization', 'Bearer abc123');
+        $request = $request->withHeader('Proxy-Authorization', 'Bearer abc123');
+
+        return $request;
     }
 }