public function collect($restrictToModules = null, $mergeWithExisting = null)
 {
     if (!is_null($restrictToModules) || !is_null($mergeWithExisting)) {
         throw new InvalidArgumentException("use of BetterI18nTextCollector->collect() with arguments is deprecated");
     }
     return parent::collect($this->restrictedModules, false);
 }
 public function testCollectMergesWithExisting()
 {
     $defaultlocal = i18n::default_locale();
     $local = i18n::get_locale();
     i18n::set_locale('en_US');
     i18n::set_default_locale('en_US');
     $c = new i18nTextCollector();
     $c->setWriter(new i18nTextCollector_Writer_Php());
     $c->basePath = $this->alternateBasePath;
     $c->baseSavePath = $this->alternateBaseSavePath;
     $entitiesByModule = $c->collect(null, true);
     $this->assertArrayHasKey('i18nTestModule.ENTITY', $entitiesByModule['i18ntestmodule'], 'Retains existing entities');
     $this->assertArrayHasKey('i18nTestModule.NEWENTITY', $entitiesByModule['i18ntestmodule'], 'Adds new entities');
 }