14 public function populate() {
15 \Civi\Test
::schema()->truncateAll();
17 \Civi\Test
::schema()->setStrict(FALSE);
18 $sqlDir = dirname(dirname(__DIR__
)) . "/sql";
20 $query2 = file_get_contents("$sqlDir/civicrm_data.mysql");
21 $query3 = file_get_contents("$sqlDir/test_data.mysql");
22 $query4 = file_get_contents("$sqlDir/test_data_second_domain.mysql");
23 if (\Civi\Test
::execute($query2) === FALSE) {
24 throw new RuntimeException("Cannot load civicrm_data.mysql. Aborting.");
26 if (\Civi\Test
::execute($query3) === FALSE) {
27 throw new RuntimeException("Cannot load test_data.mysql. Aborting.");
29 if (\Civi\Test
::execute($query4) === FALSE) {
30 throw new RuntimeException("Cannot load test_data.mysql. Aborting.");
33 unset($query, $query2, $query3);
35 \Civi\Test
::schema()->setStrict(TRUE);
38 civicrm_api('system', 'flush', array('version' => 3, 'triggers' => 1));
40 \CRM_Core_BAO_ConfigSetting
::setEnabledComponents(array(