From c8d80a5a0a27d07a1663f07ab7f997297f3ce531 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Sat, 28 Sep 2024 15:23:21 -0700 Subject: [PATCH] cv sql - Fix recent regression. Add sniff test. --- src/Command/SqlCliCommand.php | 1 + tests/Command/SqlCliCommandTest.php | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 tests/Command/SqlCliCommandTest.php diff --git a/src/Command/SqlCliCommand.php b/src/Command/SqlCliCommand.php index 367af69..added48 100644 --- a/src/Command/SqlCliCommand.php +++ b/src/Command/SqlCliCommand.php @@ -41,6 +41,7 @@ protected function initialize(InputInterface $input, OutputInterface $output) { if ($input->getOption('dry-run') && $output->getVerbosity() <= OutputInterface::VERBOSITY_NORMAL) { $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE); } + parent::initialize($input, $output); } protected function execute(InputInterface $input, OutputInterface $output): int { diff --git a/tests/Command/SqlCliCommandTest.php b/tests/Command/SqlCliCommandTest.php new file mode 100644 index 0000000..aef4ecd --- /dev/null +++ b/tests/Command/SqlCliCommandTest.php @@ -0,0 +1,21 @@ +cv("sql")->setInput($query)); + $this->assertMatchesRegularExpression('/id\s+display_name/', $p->getOutput()); + } + +}