// No access for all languages as the non language aware node access module
// denies access.
$this->
assertNodeAccess($expected_node_access_no_access,
$this->nodes
['private_no_language_public'
],
$this->webUser
);
// Query the node table with the node access tag in several languages.
$connection = Database::
getConnection();
// Query with no language specified. The fallback (hu or und) will be used.
$select =
$connection->
select('node', 'n'
) ->
fields('n',
['nid'
]) ->
addMetaData('account',
$this->webUser
) ->
addTag('node_access'
);
$nids =
$select->
execute()->
fetchAllAssoc('nid'
);
// Four nodes should be returned with public Hungarian translations or the
// no language public node.
$this->
assertCount(4,
$nids, 'Query returns 4 nodes when no langcode is specified.'
);
$this->
assertArrayHasKey($this->nodes
['public_both_public'
]->
id(),
$nids);
$this->
assertArrayHasKey($this->nodes
['public_ca_private'
]->
id(),
$nids);
$this->
assertArrayHasKey($this->nodes
['private_both_public'
]->
id(),
$nids);
$this->
assertArrayHasKey($this->nodes
['public_no_language_public'
]->
id(),
$nids);
// Query with Hungarian (hu) specified.
$select =
$connection->
select('node', 'n'
)