14 public function populate() {
15 \Civi\Test
::schema()->truncateAll();
17 \Civi\Test
::schema()->setStrict(FALSE);
19 // Ensure that when we populate the database it is done in utf8 mode
20 \Civi\Test
::execute('SET NAMES utf8');
21 $sqlDir = dirname(dirname(__DIR__
)) . "/sql";
23 $query2 = file_get_contents("$sqlDir/civicrm_data.mysql");
24 $query3 = file_get_contents("$sqlDir/test_data.mysql");
25 $query4 = file_get_contents("$sqlDir/test_data_second_domain.mysql");
26 if (\Civi\Test
::execute($query2) === FALSE) {
27 throw new RuntimeException("Cannot load civicrm_data.mysql. Aborting.");
29 if (\Civi\Test
::execute($query3) === FALSE) {
30 throw new RuntimeException("Cannot load test_data.mysql. Aborting.");
32 if (\Civi\Test
::execute($query4) === FALSE) {
33 throw new RuntimeException("Cannot load test_data.mysql. Aborting.");
36 unset($query, $query2, $query3);
38 \Civi\Test
::schema()->setStrict(TRUE);
41 civicrm_api('system', 'flush', ['version' => 3, 'triggers' => 1]);
43 \CRM_Core_BAO_ConfigSetting
::setEnabledComponents([