EntityBrowserIntegrationTest.php in Lightning Media 8.4
File
tests/src/Kernel/EntityBrowserIntegrationTest.php
View source
<?php
namespace Drupal\Tests\lightning_media\Kernel;
use Drupal\entity_browser\Entity\EntityBrowser;
use Drupal\KernelTests\KernelTestBase;
class EntityBrowserIntegrationTest extends KernelTestBase {
protected static $modules = [
'entity_browser',
'entity_browser_example',
'field',
'file',
'image',
'lightning_media',
'media',
'node',
'system',
'text',
'user',
'views',
];
protected function setUp() : void {
parent::setUp();
$this
->installSchema('system', 'key_value_expire');
$this
->installConfig('node');
$this
->installConfig('entity_browser_example');
}
public function testLibraryAttachment() : void {
$browser = EntityBrowser::load('test_files');
$this
->assertInstanceOf(EntityBrowser::class, $browser);
$form = $this->container
->get('form_builder')
->getForm($browser
->getFormObject());
$this
->assertIsArray($form);
$this
->assertNotContains('lightning_media/browser.styling', $form['#attached']['library']);
}
}