Browse Source

Fix failing tests for cookie encryption.

Mark Story 8 years ago
parent
commit
dee7331c63

+ 1 - 4
tests/TestCase/TestSuite/CookieEncryptedUsingControllerTest.php

@@ -36,10 +36,7 @@ class CookieEncryptedUsingControllerTest extends IntegrationTestCase
 
         Security::setSalt('abcdabcdabcdabcdabcdabcdabcdabcdabcd');
         Router::connect('/:controller/:action/*', [], ['routeClass' => 'InflectedRoute']);
-        DispatcherFactory::clear();
-        DispatcherFactory::add('Routing');
-        DispatcherFactory::add('ControllerFactory');
-        $this->useHttpServer(false);
+        $this->useHttpServer(true);
     }
 
     /**

+ 1 - 2
tests/test_app/TestApp/Controller/CookieComponentTestController.php

@@ -40,7 +40,7 @@ class CookieComponentTestController extends Controller
         if (isset($key)) {
             $this->Cookie->setConfig('key', $key);
         }
-        $this->set('ValueFromRequest', $this->request->cookie('NameOfCookie'));
+        $this->set('ValueFromRequest', $this->request->getCookie('NameOfCookie'));
         $this->set('ValueFromCookieComponent', $this->Cookie->read('NameOfCookie'));
     }
 
@@ -52,7 +52,6 @@ class CookieComponentTestController extends Controller
      */
     public function set_cookie($key = null)
     {
-        $this->autoRender = false;
         if (isset($key)) {
             $this->Cookie->setConfig('key', $key);
         }