Hi,
You can use:
$this->getApplicationServiceLocator()->get('viewmanager')->getViewModel()
to retrieve the layout and add ->getVariables() (Zend\View\Variables) for
layout variables.
More, if you want to retrieve the ViewModel from the controller you can do
this:
$layoutChildren =
$this->getApplicationServiceLocator()->get('viewmanager')->getViewModel();
$viewModel = $layoutChildren[0];
And of course to get all variables:
$viewModel->getVariables();
Regards
2013/10/26 Ralf Eggert <[email protected]>
> Hi,
>
> just to clarify. When I use the AbstractHttpControllerTestCase than I
> cannot access the provided ViewModel by any action, can I?
>
> I can only test the output like this:
>
> $this->assertContains('foo', $this->getResponse());
>
> So, if I want to check the ViewModel I should rather use a normal
> PHPUnit_Framework_TestCase and test a controller like a unit on its own?
>
> Is this correct?
>
> Thanks and best regards,
>
> Ralf
> --
>
> Ralf Eggert - Travello GmbH - An der Eiche 15 - 25421 Pinneberg
> Tel 04101/8529401 - Fax 04101/8529402 - Web http://de.travello.com
> Geschäftsführer: Ralf Eggert - Amtsgericht Pinneberg: HRB 6112 PI
>
> Ralf Eggert ist Autor des Buches "Zend Framework 2 - Das Praxisbuch"
> http://www.galileocomputing.de/3460?GPP=eggert
>
> Zend Framework 2 Schulung buchen: http://www.zendframeworkschulung.de
>
>
> --
> List: [email protected]
> Info: http://framework.zend.com/archives
> Unsubscribe: [email protected]
>
>
>
--
Pierre Rambaud
Website: http://pierrerambaud.com <http://rambaudpierre.fr>
G+: https://plus.google.com/u/0/107809758756474139920/posts
Github: https://github.com/PierreRambaud