4 * Generate files used during testing.
6 class CRM_Core_CodeGen_Test
extends CRM_Core_CodeGen_BaseTask
{
7 public function run() {
8 $this->generateCiviTestTruncate();
11 public function generateCiviTestTruncate() {
12 echo "Generating tests truncate file\n";
15 $truncate = '<?xml version="1.0" encoding="UTF-8" ?>
16 <!-- Truncate all tables that will be used in the tests -->
18 $tbls = array_keys($this->tables
);
19 foreach ($tbls as $d => $t) {
20 $truncate = $truncate . "\n <$t />\n";
23 $truncate = $truncate . "</dataset>\n";
24 file_put_contents($this->config
->sqlCodePath
. "../tests/phpunit/CiviTest/truncate.xml", $truncate);