Last active
August 29, 2015 13:56
-
-
Save fatorx/9196485 to your computer and use it in GitHub Desktop.
Controller Test - get variables defined for ViewModel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function testIfSetsVariablesInRequestABudgetAction() | |
{ | |
$this->createMocks(); // create mocks for services | |
$this->dispatch('/en/contact/request-a-budget'); | |
$this->assertResponseStatusCode(200); | |
$viewManager = $this->getApplicationServiceLocator()->get('ViewManager'); | |
$variables = $viewManager->getViewModel()->getChildren()[0]->getVariables(); | |
$this->assertArrayHasKey('form', $variables); | |
$this->assertInstanceOf('Services\Form\RequestABudget', $variables['form']); | |
$this->assertArrayHasKey('message', $variables); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment