You are here

public function AssetManagerTest::testGetPluginsInstalledVersion in CKEditor Media Embed Plugin 8

Tests \Drupal\ckeditor_media_embed\AssetManager::getPluginsInstalledVersion()(<version>).

File

tests/src/Unit/AssetManagerTest.php, line 151

Class

AssetManagerTest
Tests the asset manager.

Namespace

Drupal\Tests\ckeditor_media_embed\Unit

Code

public function testGetPluginsInstalledVersion() {
  $config_set = $this
    ->getMockBuilder('\\Drupal\\Core\\Config\\ImmutableConfig')
    ->disableOriginalConstructor()
    ->getMock();
  $config_set
    ->expects($this
    ->once())
    ->method('get')
    ->with('plugins_version_installed')
    ->willReturn('4.5.0');
  $config_factory = $this
    ->getMockBuilder('\\Drupal\\Core\\Config\\ConfigFactory')
    ->disableOriginalConstructor()
    ->getMock();
  $config_factory
    ->expects($this
    ->once())
    ->method('get')
    ->with('ckeditor_media_embed.settings')
    ->willReturn($config_set);
  $this
    ->assertSame('4.5.0', AssetManager::getPluginsInstalledVersion($config_factory), 'The plugin version that should be retrieved is 4.5.0');
}