Tests the invalidation of caches in Paragraphs Collection.
@group paragraphs_collection
Expanded class hierarchy of ParagraphsCollectionCacheTest
class ParagraphsCollectionCacheTest extends ParagraphsTestBase {
/**
* Tests if affected caches are invalidated upon installation of new modules.
*/
public function testCacheUpdatesForNewModules() {
$this
->loginAsAdmin([
'administer paragraphs types',
]);
// Install Paragraphs Collection which has no grid layouts or styles.
\Drupal::service('module_installer')
->install([
'paragraphs_collection',
]);
// Check that no styles are available.
$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.');
// Check that no grid layouts 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.');
// Install a module with new grid layouts and styles styles.
\Drupal::service('module_installer')
->install([
'paragraphs_collection_test',
]);
// Check that styles are now available.
$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.');
// Check that grid layouts 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.');
}
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ParagraphsCollectionCacheTest:: |
public | function | Tests if affected caches are invalidated upon installation of new modules. | |
ParagraphsTestBase:: |
protected | property | List of permissions used by loginAsAdmin(). | |
ParagraphsTestBase:: |
protected | property | Drupal user object created by loginAsAdmin(). | 1 |
ParagraphsTestBase:: |
protected | property | 2 | |
ParagraphsTestBase:: |
protected static | property | Modules to enable. | 48 |
ParagraphsTestBase:: |
function | Creates an user with admin permissions and log in. | ||
ParagraphsTestBase:: |
protected | function |
Removes the default paragraph type. Overrides ParagraphsTestBase:: |
|
ParagraphsTestBase:: |
protected | function |
Sets the Paragraphs widget add mode. Overrides ParagraphsTestBase:: |
|
ParagraphsTestBase:: |
protected | function | Sets the allowed Paragraphs types that can be added. | |
ParagraphsTestBase:: |
protected | function | Sets the default paragraph type. | |
ParagraphsTestBase:: |
protected | function | Sets the weight of a given Paragraphs type. | |
ParagraphsTestBase:: |
protected | function | Sets the Paragraphs widget display mode. | |
ParagraphsTestBase:: |
protected | function | 19 | |
ParagraphsTestBaseTrait:: |
protected | property | The workflow entity. | |
ParagraphsTestBaseTrait:: |
protected | function | Adds a field to a given paragraph type. | |
ParagraphsTestBaseTrait:: |
protected | function | Adds a content type with a Paragraphs field. | |
ParagraphsTestBaseTrait:: |
protected | function | Adds a Paragraphs field to a given entity type. | |
ParagraphsTestBaseTrait:: |
protected | function | Adds a Paragraphs type. | |
ParagraphsTestBaseTrait:: |
protected | function | Adds an icon to a paragraphs type. | |
ParagraphsTestBaseTrait:: |
protected | function | Checks the core version. | |
ParagraphsTestBaseTrait:: |
protected | function | Creates a workflow entity. | |
ParagraphsTestBaseTrait:: |
protected | function | Sets some of the settings of a paragraphs field widget. |