Skip to content
Snippets Groups Projects
Commit 8477ea47 authored by Adam G-H's avatar Adam G-H
Browse files

Actually use a real kernel test

parent b498295b
No related merge requests found
<?php
namespace Drupal\Tests\package_manager\Unit;
namespace Drupal\Tests\package_manager\Kernel;
use Drupal\package_manager\ExecutableFinder;
use Drupal\Tests\UnitTestCase;
use Symfony\Component\Process\ExecutableFinder as SymfonyExecutableFinder;
/**
......@@ -11,7 +9,7 @@ use Symfony\Component\Process\ExecutableFinder as SymfonyExecutableFinder;
*
* @group package_manager
*/
class ExecutableFinderTest extends UnitTestCase {
class ExecutableFinderTest extends PackageManagerKernelTestBase {
/**
* Tests that the executable finder looks for paths in configuration.
......@@ -27,19 +25,13 @@ class ExecutableFinderTest extends UnitTestCase {
}
};
$this->container->set('package_manager.symfony_executable_finder', $symfony_executable_finder);
$config_factory = $this->getConfigFactoryStub([
'package_manager.settings' => [
'executables' => [
'composer' => '/path/to/composer',
],
],
]);
$executable_finder = new ExecutableFinder(
$symfony_executable_finder,
$config_factory
);
$this->config('package_manager.settings')
->set('executables.composer', '/path/to/composer')
->save();
$executable_finder = $this->container->get('package_manager.executable_finder');
$this->assertSame('/path/to/composer', $executable_finder->find('composer'));
$this->assertSame('/dev/null', $executable_finder->find('rsync'));
}
......
......@@ -25,7 +25,6 @@ class ServicesTest extends KernelTestBase {
'package_manager.stager',
'package_manager.committer',
'package_manager.cleaner',
'package_manager.executable_finder',
];
foreach ($services as $service) {
$this->assertIsObject($this->container->get($service));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment