diff --git a/.github/workflows/matomo-tests.yml b/.github/workflows/matomo-tests.yml index d83f4c5..140dd27 100644 --- a/.github/workflows/matomo-tests.yml +++ b/.github/workflows/matomo-tests.yml @@ -44,6 +44,8 @@ jobs: with: lfs: true persist-credentials: false + - name: Install package ripgrep + run: sudo apt-get install ripgrep - name: Run tests uses: matomo-org/github-action-tests@main with: diff --git a/tests/System/CheckDirectDependencyUseCommandTest.php b/tests/System/CheckDirectDependencyUseCommandTest.php new file mode 100644 index 0000000..48adda2 --- /dev/null +++ b/tests/System/CheckDirectDependencyUseCommandTest.php @@ -0,0 +1,49 @@ +markTestSkipped('tests:check-direct-dependency-use is not available in this version'); + } + + $pluginName = 'CustomVariables'; + + $checkDirectDependencyUse = new CheckDirectDependencyUse(); + + $console = new \Piwik\Console(self::$fixture->piwikEnvironment); + $console->addCommands([$checkDirectDependencyUse]); + $command = $console->find('tests:check-direct-dependency-use'); + $arguments = [ + 'command' => 'tests:check-direct-dependency-use', + '--plugin' => $pluginName, + '--grep-vendor', + ]; + + $inputObject = new ArrayInput($arguments); + $command->run($inputObject, new NullOutput()); + + $this->assertEquals([ + 'Symfony\Component\Console' => [ + 'CustomVariables/tests/Commands/InfoTest.php', + 'CustomVariables/tests/Commands/SetNumberOfCustomVariablesTest.php', + 'CustomVariables/tests/System/CheckDirectDependencyUseCommandTest.php' + ], + ], $checkDirectDependencyUse->usesFoundList[$pluginName]); + } +} \ No newline at end of file