askAndRender() public method

If any requirements are missing from the Input it will demand the parameters from the user.
public askAndRender ( string $templateDomain, string $templateName ) : string
$templateDomain string Domain for the template, e.g. pull-request
$templateName string Name of the template, e.g. symfony-doc
return string Rendered template string
示例#1
0
 /**
  * @test
  * @dataProvider provideParameterize
  */
 public function parameterizes($requirements, $bindArguments)
 {
     $requirements['test-option'] = ['This is bar', 'default-foo'];
     $this->input->setOption('test-option', 'test-option');
     $this->template->getName()->willReturn('test/foobar')->shouldBeCalled();
     $this->template->getRequirements()->willReturn($requirements)->shouldBeCalled();
     $this->template->bind($bindArguments)->shouldBeCalled();
     $this->template->render()->willReturn('foo')->shouldBeCalled();
     // // less one because we test with one given option
     $this->setExpectedApplicationInput(array_fill(0, count($requirements) - 1, 'foo'));
     $this->helper->registerTemplate($this->template->reveal());
     $res = $this->helper->askAndRender('test', 'foobar');
     $this->assertEquals('foo', $res);
 }