예제 #1
0
    public function testBugCompileEmptyFunction()
    {
        Artifex::execute(<<<'EOF'
#* function foo()
#* end
EOF
);
        $this->assertTrue(true);
    }
예제 #2
0
 /**
  *  @expectedException \RuntimeException
  */
 public function testInvalidReplace()
 {
     $args = array('foo' => 'bar');
     Artifex::execute("__args__", compact('args'));
 }
예제 #3
0
    public function testDefineExecLocalFunction()
    {
        $namespace = safe_eval(Artifex::execute(<<<'EOF'
#* foo("artifex", "rulz")
#* function foo($foo, $method) 
    class __foo__ {
        function __method__() {
        }
    }
#* end
EOF
));
        $this->assertTrue(class_exists($namespace . '\\artifex'));
        $this->assertTrue(is_callable($namespace . '\\artifex', 'rulz'));
    }