Browse Source

Minor fixups.

* Don't allocate 3 arrays when we can do it in one.
* Use methods instead of manipulating internal state.
Mark Story 9 years ago
parent
commit
64ed390de0

+ 1 - 1
src/Http/ResponseTransformer.php

@@ -101,7 +101,7 @@ class ResponseTransformer
             }
 
             list($name, $value) = explode('=', array_shift($parts), 2);
-            $parsed = compact('name') + ['value' => urldecode($value)];
+            $parsed = ['name' => $name, 'value' => urldecode($value)];
 
             foreach ($parts as $part) {
                 if (strpos($part, '=') !== false) {

+ 2 - 12
tests/TestCase/TestSuite/CookieEncryptedUsingControllerTest.php

@@ -41,17 +41,7 @@ class CookieEncryptedUsingControllerTest extends IntegrationTestCase
         DispatcherFactory::clear();
         DispatcherFactory::add('Routing');
         DispatcherFactory::add('ControllerFactory');
-    }
-
-    /**
-     * tear down.
-     *
-     * @return void
-     */
-    public function tearDown()
-    {
-        parent::tearDown();
-        $this->_useHttpServer = false;
+        $this->useHttpServer(false);
     }
 
     /**
@@ -157,7 +147,7 @@ class CookieEncryptedUsingControllerTest extends IntegrationTestCase
      */
     public function testCanAssertCookieEncryptedWithAesWhenUsingPsr7()
     {
-        $this->_useHttpServer = true;
+        $this->useHttpServer(true);
         $this->get('/cookie_component_test/set_cookie');
         $this->assertCookieEncrypted('abc', 'NameOfCookie', 'aes');
     }