<commit_before><?php

/**
 * Base class to test object structures. These structures can be defined in an XML file. The XML fixture file could look
 * like:
 * <code>
 * <?xml version="1.0"?>
 * <objects>
 *  <object name="page_1" class="class_module_pages_page" strName="Page 1">
 *   <object name="page_2" class="class_module_pages_page" strName="Page 2" />
 *  </object>
 * </objects>
 * </code>
 *
 * @package module_system
 * @since 3.4
 * @author <EMAIL>
 */
abstract class class_testbase_object extends class_testbase {

    protected function setUp() {

        parent::setUp();

        $strFile = $this->getFixtureFile();
        if(!is_file($strFile)) {
            throw new RuntimeException('Could not find fixture file ' . $strFile);
        }

        $objDom = new DOMDocument();
        $objDom->load($strFile);

        $this->createStructure($objDom->documentElement);

        $this->flushDBCache();

    }

    protected function tearDown() {

        parent::tearDown();

        $this->cleanStructure();

    }

    /**
     * Creates the database structure like defined in the xml element<commit_msg>UPDATE: module_system | class_testbase_object > update meta annotations<commit_after><?php

/**
 * Base class to test object structures. These structures can be defined in an XML file. The XML fixture file could look
 * like:
 * <code>
 * <?xml version="1.0"?>
 * <objects>
 *  <object name="page_1" class="class_module_pages_page" strName="Page 1">
 *   <object name="page_2" class="class_module_pages_page" strName="Page 2" />
 *  </object>
 * </objects>
 * </code>
 *
 * @package module_system
 * @since 4.7
 * @author <EMAIL>
 */
abstract class class_testbase_object extends class_testbase {

    protected function setUp() {

        parent::setUp();

        $strFile = $this->getFixtureFile();
        if(!is_file($strFile)) {
            throw new RuntimeException('Could not find fixture file ' . $strFile);
        }

        $objDom = new DOMDocument();
        $objDom->load($strFile);

        $this->createStructure($objDom->documentElement);

        $this->flushDBCache();

    }

    protected function tearDown() {

        parent::tearDown();

        $this->cleanStructure();

    }

    /**
     * Creates the database structure like defined in the xml element
{'fraction_non_alphanumeric': 0.13671875, 'fraction_numerical': 0.006944444444444444, 'mean_word_length': 3.015679442508711, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 2, '>': 34, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2003957', 'n_tokens_mistral': 699, 'n_tokens_neox': 669, 'n_words': 178}