You are here

protected function SchemaFactoryTest::assertSchemaHasProperties in Schemata 8

Assert the schema has at least one property.

More extensive property analysis would be redundant, as the only way we could meaningfully check would be to execute the same code. This confirms the SchemaFactory was able to derive properties at all and get them into the schema object.

Parameters

\Drupal\schemata\Schema\SchemaInterface $schema: Schema to evaluate.

3 calls to SchemaFactoryTest::assertSchemaHasProperties()
SchemaFactoryTest::testCreateNodeArticleSchema in tests/src/Kernel/SchemaFactoryTest.php
@covers ::create
SchemaFactoryTest::testCreateNodeBaseSchema in tests/src/Kernel/SchemaFactoryTest.php
@covers ::create
SchemaFactoryTest::testCreateUserSchema in tests/src/Kernel/SchemaFactoryTest.php
@covers ::create

File

tests/src/Kernel/SchemaFactoryTest.php, line 164

Class

SchemaFactoryTest
Tests the Schema Factory service.

Namespace

Drupal\Tests\schemata\Kernel

Code

protected function assertSchemaHasProperties(SchemaInterface $schema) {
  $this
    ->assertGreaterThanOrEqual(1, count($schema
    ->getProperties()));
}