Commit 308db361 authored by catch's avatar catch

Issue #3151968 by Hardik_Patel_12, daffie, snehalgaikwad: Replace the database...

Issue #3151968 by Hardik_Patel_12, daffie, snehalgaikwad: Replace the database query with an entity query in NodeTranslationUITest
parent d7334ba5
......@@ -3,7 +3,6 @@
namespace Drupal\Tests\node\Functional;
use Drupal\Component\Render\FormattableMarkup;
use Drupal\Core\Database\Database;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Tests\content_translation\Functional\ContentTranslationUITestBase;
use Drupal\Core\Language\LanguageInterface;
......@@ -279,8 +278,14 @@ public function testDisabledBundle() {
]);
// Make sure that nothing was inserted into the {content_translation} table.
$rows = Database::getConnection()->query('SELECT nid, count(nid) AS count FROM {node_field_data} WHERE type <> :type GROUP BY nid HAVING count(nid) >= 2', [':type' => $this->bundle])->fetchAll();
$this->assertCount(0, $rows);
$nids = \Drupal::entityQueryAggregate('node')
->aggregate('nid', 'COUNT')
->accessCheck(FALSE)
->condition('type', $this->bundle)
->conditionAggregate('nid', 'COUNT', 2, '>=')
->groupBy('nid')
->execute();
$this->assertCount(0, $nids);
// Ensure the translation tab is not accessible.
$this->drupalGet('node/' . $node->id() . '/translations');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment