public function GridStackCrudTest::verifyGridStackOptionset in GridStack 8.2
Same name and namespace in other branches
- 8 tests/src/Kernel/GridStackCrudTest.php \Drupal\Tests\gridstack\Kernel\GridStackCrudTest::verifyGridStackOptionset()
Verifies that a gridstack optionset is properly stored.
Parameters
\Drupal\gridstack\Entity\GridStack $gridstack: The GridStack instance.
1 call to GridStackCrudTest::verifyGridStackOptionset()
- GridStackCrudTest::testGridStackCrud in tests/
src/ Kernel/ GridStackCrudTest.php - Tests CRUD operations for GridStack optionsets.
File
- tests/
src/ Kernel/ GridStackCrudTest.php, line 161
Class
- GridStackCrudTest
- Tests creation, loading, updating, deleting of GridStack optionsets.
Namespace
Drupal\Tests\gridstack\KernelCode
public function verifyGridStackOptionset(GridStack $gridstack) {
$t_args = [
'%gridstack' => $gridstack
->label(),
];
$default_langcode = \Drupal::languageManager()
->getDefaultLanguage()
->getId();
// Verify the loaded gridstack has all properties.
$gridstack = GridStack::load($gridstack
->id());
$this
->assertEquals($gridstack
->id(), $gridstack
->id(), new FormattableMarkup('GridStack::load: Proper gridstack id for gridstack optionset %gridstack.', $t_args));
$this
->assertEquals($gridstack
->label(), $gridstack
->label(), new FormattableMarkup('GridStack::load: Proper title for gridstack optionset %gridstack.', $t_args));
// Check that the gridstack was created in site default language.
$this
->assertEquals($gridstack
->language()
->getId(), $default_langcode, new FormattableMarkup('GridStack::load: Proper language code for gridstack optionset %gridstack.', $t_args));
}