public function EntityBrowserIntegrationTest::testLibraryAttachment in Lightning Media 8.4
Same name and namespace in other branches
- 8.3 tests/src/Kernel/EntityBrowserIntegrationTest.php \Drupal\Tests\lightning_media\Kernel\EntityBrowserIntegrationTest::testLibraryAttachment()
Tests that our libraries are not attached to custom entity browsers.
File
- tests/src/ Kernel/ EntityBrowserIntegrationTest.php, line 46 
Class
- EntityBrowserIntegrationTest
- Tests Lightning Media's integration with Entity Browser.
Namespace
Drupal\Tests\lightning_media\KernelCode
public function testLibraryAttachment() : void {
  /** @var \Drupal\entity_browser\EntityBrowserInterface $browser */
  $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']);
}