public function testPresistenceOfOptions()
 {
     $config = new \CodeReview\Config(array(), array($this, 'getLatestVersion'));
     $config->parseInput(array());
     $this->assertEquals('/', $config->getSubPath());
     $this->assertEquals('11.22', $config->getMaxVersion());
     $this->assertEquals(false, $config->isIncludeDisabledPluginsEnabled());
     $this->assertEquals(true, $config->isSkipInactivePluginsEnabled());
     $this->assertEquals(true, $config->isDeprecatedFunctionsTestEnabled());
     $this->assertEquals(true, $config->isPrivateFunctionsTestEnabled());
     $this->assertEquals(false, $config->isFixProblemsEnabled());
     //change stuff
     $config->subPath = '//test/invalid/path';
     $this->assertEquals('//test/invalid/path', $config->getSubPath());
     $config->maxVersion = '10.24';
     $this->assertEquals('10.24', $config->getMaxVersion());
     $config->includeDisabledPlugins = true;
     $this->assertEquals(true, $config->isIncludeDisabledPluginsEnabled());
     $this->assertEquals(false, $config->isSkipInactivePluginsEnabled());
     $config->includeDisabledPlugins = false;
     $this->assertEquals(false, $config->isIncludeDisabledPluginsEnabled());
     $this->assertEquals(true, $config->isSkipInactivePluginsEnabled());
     $config->findDeprecatedFunctions = true;
     $this->assertEquals(true, $config->isDeprecatedFunctionsTestEnabled());
     $config->findDeprecatedFunctions = false;
     $this->assertEquals(false, $config->isDeprecatedFunctionsTestEnabled());
     $config->findPrivateFunctions = true;
     $this->assertEquals(true, $config->isPrivateFunctionsTestEnabled());
     $config->findPrivateFunctions = false;
     $this->assertEquals(false, $config->isPrivateFunctionsTestEnabled());
     $config->fixProblems = true;
     $this->assertEquals(true, $config->isFixProblemsEnabled());
     $config->fixProblems = false;
     $this->assertEquals(false, $config->isFixProblemsEnabled());
 }
Example #2
0
 /**
  * @param \CodeReview\Config $options
  */
 public function __construct(\CodeReview\Config $options = null)
 {
     if ($options === null) {
         $options = new \CodeReview\Config();
     }
     $this->options = $options;
     $this->maxVersion = $options->getMaxVersion();
     $this->fixProblems = $options->isFixProblemsEnabled();
 }