class EntityReverseJoinTest
Tests the EntityReverse join plugin.
@group views
Hierarchy
- class \Drupal\KernelTests\KernelTestBase extends \PHPUnit\Framework\TestCase implements \Drupal\Core\DependencyInjection\ServiceProviderInterface uses \Drupal\KernelTests\AssertContentTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\ExtensionListTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\PhpUnitCompatibilityTrait, \Prophecy\PhpUnit\ProphecyTrait, \Drupal\TestTools\Extension\DeprecationBridge\ExpectDeprecationTrait
- class \Drupal\Tests\views\Kernel\ViewsKernelTestBase extends \Drupal\KernelTests\KernelTestBase uses \Drupal\views\Tests\ViewResultAssertionTrait
- class \Drupal\Tests\views\Kernel\Plugin\PluginKernelTestBase extends \Drupal\Tests\views\Kernel\ViewsKernelTestBase
- class \Drupal\Tests\views\Kernel\Plugin\RelationshipJoinTestBase extends \Drupal\Tests\views\Kernel\Plugin\PluginKernelTestBase
- class \Drupal\Tests\views\Kernel\Plugin\EntityReverseJoinTest extends \Drupal\Tests\views\Kernel\Plugin\RelationshipJoinTestBase
- class \Drupal\Tests\views\Kernel\Plugin\RelationshipJoinTestBase extends \Drupal\Tests\views\Kernel\Plugin\PluginKernelTestBase
- class \Drupal\Tests\views\Kernel\Plugin\PluginKernelTestBase extends \Drupal\Tests\views\Kernel\ViewsKernelTestBase
- class \Drupal\Tests\views\Kernel\ViewsKernelTestBase extends \Drupal\KernelTests\KernelTestBase uses \Drupal\views\Tests\ViewResultAssertionTrait
Expanded class hierarchy of EntityReverseJoinTest
See also
\Drupal\views\Plugin\views\relationship\EntityReverse
File
-
core/
modules/ views/ tests/ src/ Kernel/ Plugin/ EntityReverseJoinTest.php, line 16
Namespace
Drupal\Tests\views\Kernel\PluginView source
class EntityReverseJoinTest extends RelationshipJoinTestBase {
/**
* {@inheritdoc}
*/
public static $testViews = [
'test_view',
];
/**
* Tests that the EntityReverse plugin loads the correct join plugin.
*/
public function testJoinThroughRelationship() : void {
$relationship_manager = $this->container
->get('plugin.manager.views.relationship');
// Setup a simple join and test the result sql.
$view = Views::getView('test_view');
$view->initDisplay();
$view->initQuery();
$configuration = [
'id' => 'entity_reverse',
'base' => 'users_field_data',
'table' => 'users_field_data',
'field table' => 'users_field_data',
'field field' => 'uid',
'base field' => 'uid',
'field_name' => 'uid',
'join_id' => 'join_test',
];
$relationship = $relationship_manager->createInstance('entity_reverse', $configuration);
$relationship->tableAlias = 'users_field_data';
$relationship->table = 'users_field_data';
$relationship->query = $view->getQuery();
$relationship->query();
$this->assertInstanceOf(JoinTest::class, $relationship->query
->getTableQueue()[$relationship->alias]['join']);
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overrides |
---|---|---|---|---|
EntityReverseJoinTest::$testViews | public static | property | ||
EntityReverseJoinTest::testJoinThroughRelationship | public | function | Tests that the EntityReverse plugin loads the correct join plugin. | |
RelationshipJoinTestBase::$modules | protected static | property | ||
RelationshipJoinTestBase::$rootUser | protected | property | ||
RelationshipJoinTestBase::schemaDefinition | protected | function | Overrides \Drupal\views\Tests\ViewTestBase::schemaDefinition(). | |
RelationshipJoinTestBase::setUpFixtures | protected | function | ||
RelationshipJoinTestBase::viewsData | protected | function | Overrides \Drupal\views\Tests\ViewTestBase::viewsData(). | 1 |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.