comparison core/modules/views/src/Tests/ViewTestBase.php @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents c75dbcec494b
children
comparison
equal deleted inserted replaced
4:a9cd425dd02b 5:12f9dff5fda9
2 2
3 namespace Drupal\views\Tests; 3 namespace Drupal\views\Tests;
4 4
5 @trigger_error('\Drupal\views\Tests\ViewTestBase is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Instead, use \Drupal\Tests\views\Functional\ViewTestBase', E_USER_DEPRECATED); 5 @trigger_error('\Drupal\views\Tests\ViewTestBase is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Instead, use \Drupal\Tests\views\Functional\ViewTestBase', E_USER_DEPRECATED);
6 6
7 use Drupal\Core\Database\Database;
7 use Drupal\Core\Database\Query\SelectInterface; 8 use Drupal\Core\Database\Query\SelectInterface;
8 use Drupal\simpletest\WebTestBase; 9 use Drupal\simpletest\WebTestBase;
9 use Drupal\views\ViewExecutable; 10 use Drupal\views\ViewExecutable;
10 11
11 /** 12 /**
55 $this->rebuildContainer(); 56 $this->rebuildContainer();
56 $this->container->get('module_handler')->reload(); 57 $this->container->get('module_handler')->reload();
57 58
58 // Load the test dataset. 59 // Load the test dataset.
59 $data_set = $this->dataSet(); 60 $data_set = $this->dataSet();
60 $query = db_insert('views_test_data') 61 $query = Database::getConnection()->insert('views_test_data')
61 ->fields(array_keys($data_set[0])); 62 ->fields(array_keys($data_set[0]));
62 foreach ($data_set as $record) { 63 foreach ($data_set as $record) {
63 $query->values($record); 64 $query->values($record);
64 } 65 }
65 $query->execute(); 66 $query->execute();