<commit_before><?php

use Centreon\Test\Behat\CentreonContext;
use Centreon\Test\Behat\Administration\ModuleListingPage;

/**
 * Features context.
 */
class ModuleContext extends CentreonContext
{
    protected $page;
    private $moduleName = 'centreon-license-manager';

    /**
     * @Given a module is ready to install
     */
    public function aModuleIsReadyToInstall()
    {
        $this->aModuleIsReadyToRemove();
        $this->iRemoveTheModule();
        $this->theModuleIsRemoved();

        $this->page = new ModuleListingPage($this);
        $module = $this->page->getEntry($this->moduleName);
        if (!$module['actions']['install']) {
            throw new \Exception('Module ' . $this->moduleName . ' is not ready to install.');
        }
    }

    /**
     * @Given a module is ready to remove
     */
    public function aModuleIsReadyToRemove()
    {
        $this->page = new ModuleListingPage($this);
        $module = $this->page->getEntry($this->moduleName);
        if (!$module['actions']['remove']) {
            throw new \Exception('Module ' . $this->moduleName . ' is not ready to remove.');
        }
    }

    /**
     * @When I install the module
     */
    public function iInstallTheModule()
    {
        $this->page->install($this->moduleName);
    }

    /**
     * @When I remove the module
     */
    public function iRemoveTheModule()
    {<commit_msg>Fix module installation/removal acceptance tests.<commit_after><?php

use Centreon\Test\Behat\CentreonContext;
use Centreon\Test\Behat\Administration\ModuleListingPage;

/**
 * Features context.
 */
class ModuleContext extends CentreonContext
{
    protected $page;
    private $moduleName = 'centreon-license-manager';

    /**
     * @Given a module is ready to install
     */
    public function aModuleIsReadyToInstall()
    {
        $this->page = new ModuleListingPage($this);
        $module = $this->page->getEntry($this->moduleName);
        if (!$module['actions']['install']) {
            throw new \Exception('Module ' . $this->moduleName . ' is not ready to install.');
        }
    }

    /**
     * @Given a module is ready to remove
     */
    public function aModuleIsReadyToRemove()
    {
        $this->aModuleIsReadyToInstall();
        $this->iInstallTheModule();
        $this->theModuleIsInstalled();

        $this->page = new ModuleListingPage($this);
        $module = $this->page->getEntry($this->moduleName);
        if (!$module['actions']['remove']) {
            throw new \Exception('Module ' . $this->moduleName . ' is not ready to remove.');
        }
    }

    /**
     * @When I install the module
     */
    public function iInstallTheModule()
    {
        $this->page->install($this->moduleName);
    }

    /**
     * @When I remove the module
     */
    public function iRemoveTheModule()
    {
{'fraction_non_alphanumeric': 0.1420534458509142, 'fraction_numerical': 0.0, 'mean_word_length': 2.456865127582017, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 35, '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': '124500', 'n_tokens_mistral': 818, 'n_tokens_neox': 807, 'n_words': 180}