/** * @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)); }
/** * @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)); }
/** * @dataProvider setTemplateDataDataProvider */ public function testSetTemplateData($templateData) { $view = new View(); $view->setTemplateData($templateData); $this->assertEquals($templateData, $view->getTemplateData()); }