예제 #1
0
 public function testLoadConfig()
 {
     $config = new Configuration();
     $cleaner = new CodeCleaner();
     $pager = new PassthruPager(new ConsoleOutput());
     $loop = new Loop($config);
     $config->loadConfig(array('useReadline' => false, 'usePcntl' => false, 'codeCleaner' => $cleaner, 'pager' => $pager, 'loop' => $loop));
     $this->assertFalse($config->useReadline());
     $this->assertFalse($config->usePcntl());
     $this->assertSame($cleaner, $config->getCodeCleaner());
     $this->assertSame($pager, $config->getPager());
     $this->assertSame($loop, $config->getLoop());
 }
예제 #2
0
 public function testLoadConfig()
 {
     $config = new Configuration();
     $cleaner = new CodeCleaner();
     $pager = new PassthruPager(new ConsoleOutput());
     $loop = new Loop($config);
     $config->loadConfig(array('useReadline' => false, 'usePcntl' => false, 'codeCleaner' => $cleaner, 'pager' => $pager, 'loop' => $loop, 'requireSemicolons' => true, 'errorLoggingLevel' => E_ERROR | E_WARNING));
     $this->assertFalse($config->useReadline());
     $this->assertFalse($config->usePcntl());
     $this->assertSame($cleaner, $config->getCodeCleaner());
     $this->assertSame($pager, $config->getPager());
     $this->assertSame($loop, $config->getLoop());
     $this->assertTrue($config->requireSemicolons());
     $this->assertEquals(E_ERROR | E_WARNING, $config->errorLoggingLevel());
 }