UpdateTest.php in oEmbed Providers 2.x
File
tests/src/Kernel/UpdateTest.php
View source
<?php
namespace Drupal\Tests\oembed_providers\Kernel;
use Drupal\KernelTests\KernelTestBase;
use Drupal\oembed_providers\Entity\ProviderBucket;
class UpdateTest extends KernelTestBase {
protected $strictConfigSchema = FALSE;
protected static $modules = [
'media',
'oembed_providers',
];
protected function setUp() : void {
parent::setUp();
$this
->installConfig([
'oembed_providers',
]);
}
public function testUpdate8201() {
\Drupal::service('config.factory')
->getEditable('oembed_providers.settings')
->setData([
'external_fetch' => TRUE,
'allowed_providers' => [
'youtube',
'another_provider',
],
])
->save();
module_load_install('oembed_providers');
oembed_providers_update_8201();
$video_bucket = ProviderBucket::load('video');
$this
->assertEquals([
'youtube',
'another_provider',
], $video_bucket
->get('providers'));
}
}