Browse Source

Update IntegrationTestTrait::viewVariable() to use ViewBuilder.

ADmad 7 years ago
parent
commit
81c8faa9df
1 changed files with 1 additions and 8 deletions
  1. 1 8
      src/TestSuite/IntegrationTestTrait.php

+ 1 - 8
src/TestSuite/IntegrationTestTrait.php

@@ -748,14 +748,7 @@ trait IntegrationTestTrait
      */
     public function viewVariable(string $name)
     {
-        if (empty($this->_controller->viewVars)) {
-            $this->fail('There are no view variables, perhaps you need to run a request?');
-        }
-        if (isset($this->_controller->viewVars[$name])) {
-            return $this->_controller->viewVars[$name];
-        }
-
-        return null;
+        return $this->_controller->viewBuilder()->getVar($name);
     }
 
     /**