public function testLoadFunc()
 {
     $this->funcInjector->save();
     codecept_debug($this->funcInjector->getFileName());
     $this->funcInjector->inject();
     verify(strlen('hello'))->equals(5);
 }
Esempio n. 2
0
 public function registerFunc($namespace, $func, $body)
 {
     $namespace = ltrim($namespace, '\\');
     if (!function_exists("{$namespace}\\{$func}")) {
         $injector = new FunctionInjector($namespace, $func);
         $injector->save();
         $injector->inject();
     }
     $this->funcMap["{$namespace}\\{$func}"] = $body;
 }