コード例 #1
0
 public function testGetFunctions()
 {
     $functions = $this->twigExtension->getFunctions();
     $this->assertCount(6, $functions);
     /** @var \Twig_SimpleFunction $function */
     $function = $functions[0];
     $this->assertInstanceOf('\\Twig_SimpleFunction', $function);
     $this->assertEquals('oro_entity_config', $function->getName());
     $this->assertEquals(array($this->twigExtension, 'getClassConfig'), $function->getCallable());
     /** @var \Twig_SimpleFunction $function */
     $function = $functions[1];
     $this->assertInstanceOf('\\Twig_SimpleFunction', $function);
     $this->assertEquals('oro_entity_config_value', $function->getName());
     $this->assertEquals(array($this->twigExtension, 'getClassConfigValue'), $function->getCallable());
     /** @var \Twig_SimpleFunction $function */
     $function = $functions[2];
     $this->assertInstanceOf('\\Twig_SimpleFunction', $function);
     $this->assertEquals('oro_field_config', $function->getName());
     $this->assertEquals(array($this->twigExtension, 'getFieldConfig'), $function->getCallable());
     /** @var \Twig_SimpleFunction $function */
     $function = $functions[3];
     $this->assertInstanceOf('\\Twig_SimpleFunction', $function);
     $this->assertEquals('oro_field_config_value', $function->getName());
     $this->assertEquals(array($this->twigExtension, 'getFieldConfigValue'), $function->getCallable());
     /** @var \Twig_SimpleFunction $function */
     $function = $functions[4];
     $this->assertInstanceOf('\\Twig_SimpleFunction', $function);
     $this->assertEquals('oro_entity_route', $function->getName());
     $this->assertEquals(array($this->twigExtension, 'getClassRoute'), $function->getCallable());
     /** @var \Twig_SimpleFunction $function */
     $function = $functions[5];
     $this->assertInstanceOf('\\Twig_SimpleFunction', $function);
     $this->assertEquals('oro_entity_metadata_value', $function->getName());
     $this->assertEquals(array($this->twigExtension, 'getClassMetadataValue'), $function->getCallable());
 }
コード例 #2
0
 public function testGetFunctions()
 {
     $functions = $this->twigExtension->getFunctions();
     $this->assertCount(2, $functions);
     /** @var \Twig_SimpleFunction $function */
     $function = $functions[0];
     $this->assertInstanceOf('\\Twig_SimpleFunction', $function);
     $this->assertEquals('oro_entity_config', $function->getName());
     $this->assertEquals(array($this->twigExtension, 'getClassConfig'), $function->getCallable());
     /** @var \Twig_SimpleFunction $function */
     $function = $functions[1];
     $this->assertInstanceOf('\\Twig_SimpleFunction', $function);
     $this->assertEquals('oro_entity_config_value', $function->getName());
     $this->assertEquals(array($this->twigExtension, 'getClassConfigValue'), $function->getCallable());
 }