function registerFromFile($file)
 {
     $infos = lmbMacroAnnotationParser::extractFromFile($file, 'lmbMacroFilterInfo');
     foreach ($infos as $info) {
         $this->register($info, $file);
     }
 }
    function testExtractSeveralFromFile()
    {
        $rnd = mt_rand();
        $contents = <<<EOD
<?php
/**
 * @tag foo_{$rnd}
 */
class Foo{$rnd}Tag extends lmbMacroTag{}

/**
 * @tag bar_{$rnd}
 */
class Bar{$rnd}Tag extends lmbMacroTag{}
EOD;
        file_put_contents($file = LIMB_VAR_DIR . '/tags/' . $rnd . '.tag.php', $contents);
        $listener = new MockMacroAnnotationParserListener();
        $listener->expectCallCount('createByAnnotations', 2);
        $listener->expectArgumentsAt(0, 'createByAnnotations', array($file, "Foo{$rnd}Tag", array('tag' => "foo_{$rnd}")));
        $listener->expectArgumentsAt(1, 'createByAnnotations', array($file, "Bar{$rnd}Tag", array('tag' => "bar_{$rnd}")));
        $info = lmbMacroAnnotationParser::extractFromFile($file, $listener);
    }