ParagraphsCollectionCacheTest.php in Paragraphs Collection 8
File
tests/src/Functional/ParagraphsCollectionCacheTest.php
View source
<?php
namespace Drupal\Tests\paragraphs_collection\Functional;
use Drupal\Tests\paragraphs\Functional\WidgetStable\ParagraphsTestBase;
class ParagraphsCollectionCacheTest extends ParagraphsTestBase {
public function testCacheUpdatesForNewModules() {
$this
->loginAsAdmin([
'administer paragraphs types',
]);
\Drupal::service('module_installer')
->install([
'paragraphs_collection',
]);
$this
->drupalGet('admin/reports/paragraphs_collection/styles');
$tds = $this
->xpath('//table[contains(@class, :class)]//td', [
':class' => 'paragraphs-collection-overview-table',
]);
$this
->assertTrue(!isset($tds[0]), 'No styles are available.');
$this
->drupalGet('admin/reports/paragraphs_collection/layouts');
$tds = $this
->xpath('//table[contains(@class, :class)]//td', [
':class' => 'paragraphs-collection-overview-table',
]);
$this
->assertTrue(!isset($tds[0]), 'No grid layouts are available.');
\Drupal::service('module_installer')
->install([
'paragraphs_collection_test',
]);
$this
->drupalGet('admin/reports/paragraphs_collection/styles');
$tds = $this
->xpath('//table[contains(@class, :class)]//td', [
':class' => 'paragraphs-collection-overview-table',
]);
$this
->assertTrue(isset($tds[0]), 'Styles are now available.');
$this
->drupalGet('admin/reports/paragraphs_collection/layouts');
$tds = $this
->xpath('//table[contains(@class, :class)]//td', [
':class' => 'paragraphs-collection-overview-table',
]);
$this
->assertTrue(isset($tds[0]), 'Grid layouts are now available.');
}
}