Composer\Satis\Builder\WebBuilder::setTwigEnvironment PHP Method

setTwigEnvironment() public method

Sets the twig environment.
public setTwigEnvironment ( Twig_Environment $twig )
$twig Twig_Environment
    public function setTwigEnvironment(\Twig_Environment $twig)
    {
        $this->twig = $twig;
        return $this;
    }

Usage Example

Example #1
0
 public function testTwigEnvironment()
 {
     $twig = new \Twig_Environment(new \Twig_Loader_Array([]));
     $this->webBuilder->setTwigEnvironment($twig);
     $reflection = new \ReflectionClass($this->webBuilder);
     $method = $reflection->getMethod('getTwigEnvironment');
     $method->setAccessible(true);
     $this->assertSame($twig, $method->invoke($this->webBuilder));
 }