function RevisionableContentEntityBaseTest::assertItemsTableCount
Same name in other branches
- 9 core/tests/Drupal/KernelTests/Core/Entity/RevisionableContentEntityBaseTest.php \Drupal\KernelTests\Core\Entity\RevisionableContentEntityBaseTest::assertItemsTableCount()
- 10 core/tests/Drupal/KernelTests/Core/Entity/RevisionableContentEntityBaseTest.php \Drupal\KernelTests\Core\Entity\RevisionableContentEntityBaseTest::assertItemsTableCount()
- 11.x core/tests/Drupal/KernelTests/Core/Entity/RevisionableContentEntityBaseTest.php \Drupal\KernelTests\Core\Entity\RevisionableContentEntityBaseTest::assertItemsTableCount()
Asserts the amount of items on entity related tables.
Parameters
int $count: The number of items expected to be in revisions related tables.
\Drupal\Core\Entity\EntityTypeInterface $definition: The definition and metadata of the entity being tested.
1 call to RevisionableContentEntityBaseTest::assertItemsTableCount()
- RevisionableContentEntityBaseTest::testRevisionableContentEntity in core/
tests/ Drupal/ KernelTests/ Core/ Entity/ RevisionableContentEntityBaseTest.php - Tests the correct functionality CRUD operations of entity revisions.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Entity/ RevisionableContentEntityBaseTest.php, line 179
Class
- RevisionableContentEntityBaseTest
- Test the revision system.
Namespace
Drupal\KernelTests\Core\EntityCode
protected function assertItemsTableCount($count, EntityTypeInterface $definition) {
$connection = Database::getConnection();
$this->assertEqual(1, $connection->query('SELECT COUNT(*) FROM {' . $definition->getBaseTable() . '}')
->fetchField());
$this->assertEqual(1, $connection->query('SELECT COUNT(*) FROM {' . $definition->getDataTable() . '}')
->fetchField());
$this->assertEqual($count, $connection->query('SELECT COUNT(*) FROM {' . $definition->getRevisionTable() . '}')
->fetchField());
$this->assertEqual($count, $connection->query('SELECT COUNT(*) FROM {' . $definition->getRevisionDataTable() . '}')
->fetchField());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.