Browse Source

prove that options are passed to the viewBuilder

antograssiot 10 years ago
parent
commit
5bbf227a6a
1 changed files with 14 additions and 1 deletions
  1. 14 1
      tests/TestCase/View/ViewVarsTraitTest.php

+ 14 - 1
tests/TestCase/View/ViewVarsTraitTest.php

@@ -134,7 +134,7 @@ class ViewVarsTraitTest extends TestCase
     }
     }
 
 
     /**
     /**
-     * test setting $merge `false` overrides currect options.
+     * test setting $merge `false` overrides correct options.
      *
      *
      * @return void
      * @return void
      */
      */
@@ -177,6 +177,19 @@ class ViewVarsTraitTest extends TestCase
     }
     }
 
 
     /**
     /**
+     * test that options are passed to the view builder when using createView().
+     *
+     * @return void
+     */
+    public function testViewOptionsGetsToBuilder()
+    {
+        $this->subject->passedArgs = 'test';
+        $this->subject->createView();
+        $result = $this->subject->viewbuilder()->options();
+        $this->assertEquals(['passedArgs' => 'test'], $result);
+    }
+
+    /**
      * test createView() throws exception if view class cannot be found
      * test createView() throws exception if view class cannot be found
      *
      *
      * @expectedException \Cake\View\Exception\MissingViewException
      * @expectedException \Cake\View\Exception\MissingViewException