You are here

protected function SqlTest::setupViewWithRelationships in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/views/tests/src/Unit/Plugin/query/SqlTest.php \Drupal\Tests\views\Unit\Plugin\query\SqlTest::setupViewWithRelationships()
  2. 9 core/modules/views/tests/src/Unit/Plugin/query/SqlTest.php \Drupal\Tests\views\Unit\Plugin\query\SqlTest::setupViewWithRelationships()

Create a view with a relationship.

4 calls to SqlTest::setupViewWithRelationships()
SqlTest::testLoadEntitiesWithNonEntityRelationship in core/modules/views/tests/src/Unit/Plugin/query/SqlTest.php
@covers ::loadEntities @covers ::assignEntitiesToResult
SqlTest::testLoadEntitiesWithRelationship in core/modules/views/tests/src/Unit/Plugin/query/SqlTest.php
@covers ::loadEntities @covers ::assignEntitiesToResult
SqlTest::testLoadEntitiesWithRelationshipAndRevision in core/modules/views/tests/src/Unit/Plugin/query/SqlTest.php
@covers ::loadEntities @covers ::assignEntitiesToResult
SqlTest::testLoadEntitiesWithRevisionOfSameEntityType in core/modules/views/tests/src/Unit/Plugin/query/SqlTest.php
@covers ::loadEntities @covers ::assignEntitiesToResult

File

core/modules/views/tests/src/Unit/Plugin/query/SqlTest.php, line 317

Class

SqlTest
@coversDefaultClass \Drupal\views\Plugin\views\query\Sql

Namespace

Drupal\Tests\views\Unit\Plugin\query

Code

protected function setupViewWithRelationships(ViewExecutable $view, $base = 'entity_second') {

  // We don't use prophecy, because prophecy enforces methods.
  $relationship = $this
    ->getMockBuilder(RelationshipPluginBase::class)
    ->disableOriginalConstructor()
    ->getMock();
  $relationship->definition['base'] = $base;
  $relationship->tableAlias = $base;
  $relationship->alias = $base;
  $view->relationship[$base] = $relationship;
}