public function testPushPopLevel() { $this->assertEquals(ClearIce::OUTPUT_LEVEL_1, ClearIce::getOutputLevel()); ClearIce::pushOutputLevel(ClearIce::OUTPUT_LEVEL_3); $this->assertEquals(ClearIce::OUTPUT_LEVEL_3, ClearIce::getOutputLevel()); ClearIce::popOutputLevel(ClearIce::OUTPUT_LEVEL_1); ClearIce::pushOutputLevel(ClearIce::OUTPUT_LEVEL_3); ClearIce::pushOutputLevel(ClearIce::OUTPUT_LEVEL_2); ClearIce::resetOutputLevel(); $this->assertEquals(ClearIce::OUTPUT_LEVEL_1, ClearIce::getOutputLevel()); }
$class = "\\yentu\\commands\\" . ucfirst($options['__command__']); unset($options['__command__']); Config::readPath(Yentu::getPath('config'), 'yentu'); $command = new $class(); $command->run($options); } else { ClearIce::output(ClearIce::getHelpMessage()); } } catch (\yentu\exceptions\CommandException $e) { ClearIce::resetOutputLevel(); ClearIce::error("Error! " . $e->getMessage() . "\n"); } catch (\ntentan\atiaa\exceptions\DatabaseDriverException $e) { ClearIce::resetOutputLevel(); ClearIce::error("Database driver failed: " . $e->getMessage() . "\n"); Yentu::reverseCommand($command); } catch (\yentu\exceptions\DatabaseManipulatorException $e) { ClearIce::resetOutputLevel(); ClearIce::error("Failed to perform database action: " . $e->getMessage() . "\n"); Yentu::reverseCommand($command); } catch (\ntentan\atiaa\DescriptionException $e) { ClearIce::resetOutputLevel(); ClearIce::error("Failed to perform database action: " . $e->getMessage() . "\n"); Yentu::reverseCommand($command); } catch (\yentu\exceptions\SyntaxErrorException $e) { ClearIce::resetOutputLevel(); ClearIce::error("Error found in syntax: {$e->getMessage()}\n"); Yentu::reverseCommand($command); } catch (\PDOException $e) { ClearIce::resetOutputLevel(); ClearIce::error("Failed to connect to database: {$e->getMessage()}\n"); }