Skip to content
Snippets Groups Projects
Unverified Commit 67a30ac6 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3229734 by quietone, danflanagan8, Kristen Pol: Improve test and add...

Issue #3229734 by quietone, danflanagan8, Kristen Pol: Improve test and add comments to ContentEntityTest

(cherry picked from commit 0bed3aee)
parent d6ead31b
No related branches found
No related tags found
5 merge requests!10011Issue #3200534 by quietone, longwave, Kristen Pol: Use dataprovider for...,!2571Issue #3000717: Missing mapping for "nodereference_url" widget,!2521Issue #3185775: Place Views preview on the side on large monitors,!1479Issue #3250298: Return empty string "" with JSON Serializer instead of FALSE,!1478Issue #3250298: Return empty string "" with JSON Serializer instead of FALSE
......@@ -127,6 +127,7 @@ protected function setUp(): void {
['target_bundles' => [$this->vocabulary]],
FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED
);
// Create a term reference field on user.
$this->createEntityReferenceField(
'user',
......@@ -139,7 +140,8 @@ protected function setUp(): void {
FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED
);
// Create some data.
// Create a node, with data in a term reference field, and then add a French
// translation of the node.
$this->user = User::create([
'name' => 'user123',
'uid' => 1,
......@@ -147,11 +149,12 @@ protected function setUp(): void {
]);
$this->user->save();
$this->anon = User::create([
// Add the anonymous user so we can test later that it is not provided in a
// source row.
User::create([
'name' => 'anon',
'uid' => 0,
]);
$this->anon->save();
])->save();
$term = Term::create([
'vid' => $this->vocabulary,
......@@ -216,7 +219,9 @@ public function testUserSource(array $configuration) {
$user_source = $migration->getSourcePlugin();
$this->assertSame('users', $user_source->__toString());
if (!$configuration['include_translations']) {
// Confirm that the query does not return a row for the anonymous user.
// Confirm that the anonymous user is in the source database but not
// included in the rows returned by the content_entity.
$this->assertNotNull(User::load(0));
$this->assertEquals(1, $user_source->count());
}
$this->assertIds($user_source, $configuration);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment