Exemplo n.º 1
0
 protected function getEnvironment()
 {
     $env = new Apishka_Templater_Environment(new Apishka_Templater_Loader_Array(array()));
     $env->addTest(Apishka_Templater_Test::apishka('anonymous', function () {
     }));
     return $env;
 }
Exemplo n.º 2
0
 public function getTests()
 {
     return array(Apishka_Templater_Test::apishka('foo_test'));
 }
Exemplo n.º 3
0
 /**
  * Get tests
  *
  * @return array
  */
 public function getTests()
 {
     $result = array();
     $data = Apishka_Templater_Node_Expression_TestRouter::apishka()->getData();
     foreach ($data as $name => $info) {
         $result[] = Apishka_Templater_Test::apishka($name, null, array('node_class' => $info['class']));
     }
     return $result;
 }
Exemplo n.º 4
0
 public function addTest(Apishka_Templater_Test $test)
 {
     $this->tests[$test->getName()] = $test;
 }
Exemplo n.º 5
0
 /**
  * Registers a Test.
  *
  * @param Apishka_Templater_Test $test A Apishka_Templater_Test instance
  */
 public function addTest(Apishka_Templater_Test $test)
 {
     if ($this->extensionInitialized) {
         throw new LogicException(sprintf('Unable to add test "%s" as extensions have already been initialized.', $test->getName()));
     }
     $this->staging->addTest($test);
 }