public function testImportStaticsWithSpecifiedListOfMethods()
 {
     $this->provider->importStatics('\\TreeBuilder\\Test\\Transformation\\MethodsCollection', array('static_method_1'));
     $this->assertEquals('static_method_1', call_user_func($this->provider->get('static_method_1'), ''));
     $this->assertFalse($this->provider->has('static_method_2'));
 }
Beispiel #2
0
 /**
  * Returns a tree node builder loaded with common transformations.
  *
  * @return TreeBuilder
  */
 public static function builder()
 {
     $provider = new TransformationProvider();
     $provider->importStatics('\\TreeBuilder\\Transformation\\Common');
     return new TreeBuilder(null, $provider);
 }