public function UpdateManagerTest::testGetAvailable in Lightning Core 8.2
Same name and namespace in other branches
- 8.5 tests/src/Kernel/UpdateManagerTest.php \Drupal\Tests\lightning_core\Kernel\UpdateManagerTest::testGetAvailable()
- 8 tests/src/Kernel/UpdateManagerTest.php \Drupal\Tests\lightning_core\Kernel\UpdateManagerTest::testGetAvailable()
- 8.3 tests/src/Kernel/UpdateManagerTest.php \Drupal\Tests\lightning_core\Kernel\UpdateManagerTest::testGetAvailable()
- 8.4 tests/src/Kernel/UpdateManagerTest.php \Drupal\Tests\lightning_core\Kernel\UpdateManagerTest::testGetAvailable()
@covers ::getAvailable
File
- tests/
src/ Kernel/ UpdateManagerTest.php, line 25
Class
- UpdateManagerTest
- @coversDefaultClass \Drupal\lightning_core\UpdateManager
Namespace
Drupal\Tests\lightning_core\KernelCode
public function testGetAvailable() {
$discovery = $this
->prophesize(DiscoveryInterface::class);
$discovery
->getDefinitions()
->willReturn([
'fubar:1.2.1' => [
'id' => '1.2.1',
'provider' => 'fubar',
],
'fubar:1.2.2' => [
'id' => '1.2.2',
'provider' => 'fubar',
],
'fubar:1.2.3' => [
'id' => '1.2.3',
'provider' => 'fubar',
],
]);
$this->container
->get('config.factory')
->getEditable(UpdateManager::CONFIG_NAME)
->set('fubar', '1.2.2')
->save();
$update_manager = new UpdateManager($this->container
->get('container.namespaces'), $this->container
->get('class_resolver'), $this->container
->get('config.factory'), $discovery
->reveal());
$definitions = $update_manager
->getAvailable();
$this
->assertCount(1, $definitions);
$this
->assertArrayHasKey('fubar:1.2.3', $definitions);
}