コード例 #1
0
ファイル: Application.php プロジェクト: kiler129/TorrentGhost
 private function initializeRules()
 {
     $this->logger->debug('Initialization of rules started');
     $this->downloadRules = [];
     $rules = $this->configurationProvider->getRulesNames();
     $this->logger->debug('Found ' . count($rules) . ' rule(s)');
     foreach ($rules as $ruleName) {
         $this->logger->debug("Initializing {$ruleName} rule");
         $this->downloadRules[] = $this->configurationProvider->getRule($ruleName);
         //In that case it will never return false since names are sourced from getRulesNames()
         $this->logger->debug("{$ruleName} rule initialized");
     }
     $this->logger->debug('All rules ready');
 }
コード例 #2
0
 public function testGetRuleReturnsFalseForUnknownRule()
 {
     $configuration = $this->subjectUnderTest->getRule('PiratedStuff');
     $this->assertFalse($configuration);
 }