コード例 #1
0
 /**
  * @dataProvider prepareTemplateParametersDataProvider
  */
 public function testPrepareTemplateParametersWithProvider($viewData, $templateData, $expected)
 {
     $handler = $this->createViewHandler(['html' => true]);
     $handler->setSerializationContextAdapter($this->getMock('FOS\\RestBundle\\Context\\Adapter\\SerializationContextAdapterInterface'));
     $view = new View();
     $view->setFormat('html');
     $view->setData($viewData);
     if (null !== $templateData) {
         $view->setTemplateData($templateData);
     }
     $this->assertEquals($expected, $handler->prepareTemplateParameters($view));
 }
コード例 #2
0
 /**
  * @dataProvider prepareTemplateParametersDataProvider
  */
 public function testPrepareTemplateParametersWithProvider($viewData, $templateData, $expected)
 {
     $handler = new ViewHandler(array('html' => true));
     $view = new View();
     $view->setFormat('html');
     $view->setData($viewData);
     if (null !== $templateData) {
         $view->setTemplateData($templateData);
     }
     $this->assertEquals($expected, $handler->prepareTemplateParameters($view));
 }
コード例 #3
0
ファイル: ViewTest.php プロジェクト: LamaDelRay/test_symf
 /**
  * @dataProvider setTemplateDataDataProvider
  */
 public function testSetTemplateData($templateData)
 {
     $view = new View();
     $view->setTemplateData($templateData);
     $this->assertEquals($templateData, $view->getTemplateData());
 }