Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/matomo-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ jobs:
lfs: true
persist-credentials: false
submodules: true
- name: Install package ripgrep
run: sudo apt-get install ripgrep
- name: Run tests
uses: matomo-org/github-action-tests@main
with:
Expand Down
45 changes: 45 additions & 0 deletions tests/System/CheckDirectDependencyUseCommandTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php
/**
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
namespace Piwik\Plugins\LoginLdap\tests\System;

use Piwik\Plugins\TestRunner\Commands\CheckDirectDependencyUse;
use Piwik\Tests\Framework\TestCase\SystemTestCase;
use Piwik\Version;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\NullOutput;

class CheckDirectDependencyUseCommandTest extends SystemTestCase
{
public function testCommand()
{
if (version_compare(Version::VERSION, '5.0.3', '<=') && !file_exists(PIWIK_INCLUDE_PATH . '/plugins/TestRunner/Commands/CheckDirectDependencyUse.php')) {
$this->markTestSkipped('tests:check-direct-dependency-use is not available in this version');
}
$pluginName = 'LoginLdap';
$console = new \Piwik\Console(self::$fixture->piwikEnvironment);
$checkDirectDependencyUse = new CheckDirectDependencyUse();
$console->addCommands([$checkDirectDependencyUse]);
$command = $console->find('tests:check-direct-dependency-use');
$arguments = array(
'command' => 'tests:check-direct-dependency-use',
'--plugin' => $pluginName
);
$inputObject = new ArrayInput($arguments);
$command->run($inputObject, new NullOutput());

$this->assertEquals([
'DI' => [
'LoginLdap/tests/Integration/Commands/SynchronizeUsersTest.php'
],
'Symfony\Component\Console' => [
'LoginLdap/tests/Integration/Commands/SynchronizeUsersTest.php',
'LoginLdap/tests/System/CheckDirectDependencyUseCommandTest.php',
]
], $checkDirectDependencyUse->usesFoundList[$pluginName]);
}
}