<commit_before><?php


use Codeception\Configuration;

/**
 * Inherited Methods
 * @method void wantToTest($text)
 * @method void wantTo($text)
 * @method void execute($callable)
 * @method void expectTo($prediction)
 * @method void expect($prediction)
 * @method void amGoingTo($argumentation)
 * @method void am($role)
 * @method void lookForwardTo($achieveValue)
 * @method void comment($description)
 * @method \Codeception\Lib\Friend haveFriend($name, $actorClass = NULL)
 *
 * @SuppressWarnings(PHPMD)
*/
class InstallTester extends \Codeception\Actor
{
    use _generated\InstallTesterActions;

    /**
     * Tests the old version detected screen and moves to the next stage in the wizard
     */
    public function maySeeOldVersionDetected()
    {
        $I = $this;
        $scenario = $I->getScenario();

        if(version_compare(phpversion(), SUITECRM_PHP_REC_VERSION, '>=')) {
            $scenario->skip('PHP Version '. PHP_VERSION .' meets the recommended requirements.');
        } else {
            $scenario->comment('PHP Version '. PHP_VERSION .' does not meet the recommended requirements.');
            $I->see('Old PHP Version Detected');
            $I->dontSeeMissingLabels();
            $I->checkOption('setup_old_php');
            $I->click('Next');
            $I->waitForText('GNU AFFERO GENERAL PUBLIC LICENSE');
        }
    }

    /**
     * Accept the license agreement and moves to the next stage of the wizard
     */
    public function acceptLicense()
    {
        $I = $this;
        $I->comment('Accept the license agreement.');
        $I->seeElement('.licensetext');
        $I->seeElement('#licenseaccept');
        $I->seeElement('#button_print_license');
        $I->dontSeeMissingLabels();
        $I->click('I Accept');
        $I->click('Next');

        // Wait for next screen. Fail if next button doesn't work
        $I->waitForText('System Environment');
    }


    /**
     * Tests the System Environment Stage and moves to the next stage of the wizard
     */
    public function seeValidSystemEnvironment()
    {
        $I = $this;
        $I->comment('View System Environment.');
        $I->see('System Environment');
        $I->dontSeeMissingLabels();
        $I->click('Next');
        $I->waitForText('Database Configuration');
    }

    /**
     * @param \Helper\WebDriverHelper $webDriverHelper
     * @throws Exception
     * Configures the installer based on the webdriver configuration and moves to the next stage of the wizard
     */
    public function configureInstaller(\Helper\WebDriverHelper $webDriverHelper)
    {
        $I = $this;
        $I->comment('View System Environment.');
        $I->see('Database Configuration');
        $I->dontSeeMissingLabels();

        // TODO: TASK: UNDEFINED - Add mocha testing here
        // TODO: TASK: UNDEFINED - Add tests for form validation

        // Select Database type
        switch ($webDriverHelper->getDatabaseDriver())<commit_msg>Updating comment<commit_after><?php


use Codeception\Configuration;

/**
 * Inherited Methods
 * @method void wantToTest($text)
 * @method void wantTo($text)
 * @method void execute($callable)
 * @method void expectTo($prediction)
 * @method void expect($prediction)
 * @method void amGoingTo($argumentation)
 * @method void am($role)
 * @method void lookForwardTo($achieveValue)
 * @method void comment($description)
 * @method \Codeception\Lib\Friend haveFriend($name, $actorClass = NULL)
 *
 * @SuppressWarnings(PHPMD)
*/
class InstallTester extends \Codeception\Actor
{
    use _generated\InstallTesterActions;

    /**
     * Tests the old version detected screen and moves to the next stage in the wizard
     */
    public function maySeeOldVersionDetected()
    {
        $I = $this;
        $scenario = $I->getScenario();

        if(version_compare(phpversion(), SUITECRM_PHP_REC_VERSION, '>=')) {
            $scenario->skip('PHP Version '. PHP_VERSION .' meets the recommended requirements.');
        } else {
            $scenario->comment('PHP Version '. PHP_VERSION .' does not meet the recommended requirements.');
            $I->see('Old PHP Version Detected');
            $I->dontSeeMissingLabels();
            $I->checkOption('setup_old_php');
            $I->click('Next');
            $I->waitForText('GNU AFFERO GENERAL PUBLIC LICENSE');
        }
    }

    /**
     * Accept the license agreement and moves to the next stage of the wizard
     */
    public function acceptLicense()
    {
        $I = $this;
        $I->comment('Accept the license agreement.');
        $I->seeElement('.licensetext');
        $I->seeElement('#licenseaccept');
        $I->seeElement('#button_print_license');
        $I->dontSeeMissingLabels();
        $I->click('I Accept');
        $I->click('Next');

        // Wait for next screen. Fail if next button doesn't work
        $I->waitForText('System Environment');
    }


    /**
     * Tests the System Environment Stage and moves to the next stage of the wizard
     */
    public function seeValidSystemEnvironment()
    {
        $I = $this;
        $I->comment('View System Environment.');
        $I->see('System Environment');
        $I->dontSeeMissingLabels();
        $I->click('Next');
        $I->waitForText('Database Configuration');
    }

    /**
     * @param \Helper\WebDriverHelper $webDriverHelper
     * @throws Exception
     * Configures the installer based on the webdriver configuration and moves to the next stage of the wizard
     */
    public function configureInstaller(\Helper\WebDriverHelper $webDriverHelper)
    {
        $I = $this;
        $I->comment('Configure installer using Web Driver configuration.');
        $I->see('Database Configuration');
        $I->dontSeeMissingLabels();

        // TODO: TASK: UNDEFINED - Add mocha testing here
        // TODO: TASK: UNDEFINED - Add tests for form validation

        // Select Database type
        switch ($webDriverHelper->getDatabaseDriver())
{'fraction_non_alphanumeric': 0.12822229661868095, 'fraction_numerical': 0.0, 'mean_word_length': 2.727386150966937, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 55, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '7298738', 'n_tokens_mistral': 1652, 'n_tokens_neox': 1618, 'n_words': 443}