@param $interactive

@return array
177605
protected function getInstallationData($interactive)
    {
        if (!$interactive) {
            $installationData = [
                'acceptanceSuite' => 'acceptance',
                'functionalSuite' => 'functional',
                'wpunitSuite' => 'wpunit',
                'acceptanceSuiteSlug' => 'acceptance',
                'functionalSuiteSlug' => 'functional',
                'wpunitSuiteSlug' => 'wpunit',
                'testSiteDbHost' => 'localhost',
                'testSiteDbName' => 'wp',
                'testSiteDbUser' => 'root',
                'testSiteDbPassword' => '',
                'testSiteTablePrefix' => 'wp_',
                'testSiteWpUrl' => 'http://wp.test',
                'testSiteWpDomain' => 'wp.test',
                'testSiteAdminUsername' => 'admin',
                'testSiteAdminPassword' => 'password',
                'testSiteAdminEmail' => 'admin@wp.test',
                'testSiteWpAdminPath' => '/wp-admin',
                'wpRootFolder' => '/var/www/html',
                'testDbName' => 'wpTests',
                'testDbHost' => 'localhost',
                'testDbUser' => 'root',
                'testDbPassword' => '',
                'testTablePrefix' => 'wp_',
                'title' => 'WP Test',
                // deactivate all modules that could trigger exceptions when initialized with sudo values
                'activeModules' => ['WPDb' => false, 'WordPress' => false, 'WPLoader' => false],
            ];
            $this->envFileName = '.env.testing';
        } else {
            $installationData = $this->askForInstallationData();
        }

        return $installationData;
    }
1024265
public function choice($choiceIdent)
    {
        if (!isset($this->choices[$choiceIdent])) {
            return [
                'value' => $choiceIdent,
                'label' => ''
            ];
        }

        return $this->choices[$choiceIdent];
    }
333425
def names(self):
        """"""
        ret = set()
        for arr in self:
            if isinstance(arr, InteractiveList):
                ret.update(arr.names)
            else:
                ret.add(arr.name)
        return ret
48123
public function individualBoxMenu(Individual $individual): array
    {
        $menus = array_merge(
            $this->individualBoxMenuCharts($individual),
            $this->individualBoxMenuFamilyLinks($individual)
        );

        return $menus;
    }
966596
public function getImplementedInterfaces()
    {
        $result = array();
        foreach ($this->getReflectionClass()->getInterfaces() as $interface)
        {
            $result[] = Type::byReflectionClass($interface);
        }
        return $result;
    }
251160
protected function _getRequestData(EntityInterface $entity)
    {
        $pk = (string)TableRegistry::get($entity->source())->primaryKey();
        $data = $this->_controller->request->data('comment');
        $return = [
            'parent_id' => null,
            'subject' => '',
            'body' => '',
            'status' => 'pending',
            'author_name' => null,
            'author_email' => null,
            'author_web' => null,
            'author_ip' => $this->_controller->request->clientIp(),
            'table_alias' => $this->_getTableAlias($entity),
            'entity_id' => $entity->get($pk),
        ];

        if (!empty($this->_controller->request->data['comment'])) {
            $data = $this->_controller->request->data['comment'];
        }

        if ($this->_controller->request->is('userLoggedIn')) {
            $return['user_id'] = user()->id;
            $return['author_name'] = null;
            $return['author_email'] = null;
            $return['author_web'] = null;
        } else {
            $return['author_name'] = !empty($data['author_name']) ? h($data['author_name']) : null;
            $return['author_email'] = !empty($data['author_email']) ? h($data['author_email']) : null;
            $return['author_web'] = !empty($data['author_web']) ? h($data['author_web']) : null;
        }

        if (!empty($data['subject'])) {
            $return['subject'] = h($data['subject']);
        }

        if (!empty($data['parent_id'])) {
            // this is validated at Model side
            $return['parent_id'] = $data['parent_id'];
        }

        if (!empty($data['body'])) {
            $return['body'] = TextToolbox::process($data['body'], $this->config('settings.text_processing'));
        }

        if ($this->config('settings.auto_approve') ||
            $this->_controller->request->is('userAdmin')
        ) {
            $return['status'] = 'approved';
        }

        return $return;
    }
382482
public function getParameters(array $additionnal_parameters = array())
    {
        return array_merge(array(
            'username'  => $this->username,
            'password'  => $this->password,
            'account'   => $this->accountRef,
            'plainText' => '1',
        ), $additionnal_parameters);
    }
292587
public function load($input)
    {
        foreach ($this->strategies as $strategy) {
            if ($strategy->supports($input)) {
                return array_map([$this, 'createJsonDefinition'], $strategy->load($input));
            }
        }

        return [];
    }
221222
public function getPlayableGames($entry = null)
    {
        $sortedPlayableGames = array();
        foreach ($this->missionGames as $missionGame) {
            $g = $missionGame->getGame();
            
            if ($g->isStarted() && $g->getActive()) {
                if (!$missionGame->getConditions() || $missionGame->fulfillConditions($entry)) {
                    $sortedPlayableGames[$missionGame->getPosition()] = $missionGame;
                }
            }
        }

        return $sortedPlayableGames;
    }
899561
public function removeInteraction(Interaction $interaction){
        $returnValue = false;

        if(!is_null($interaction)){
            $returnValue = $this->getBody()->removeElement($interaction);
        }

        return (bool) $returnValue;
    }
543214
private function getItems(PropertyInterface $property)
    {
        $value = $this->getValue($property);
        if (!is_array($value['items']) || 0 === count($value['items'])) {
            return [];
        }

        return $value['items'];
    }
165577
public function setup($interactive = true)
    {
        /** @noinspection PhpUnhandledExceptionInspection */
        $this->checkInstalled($this->workDir);

        $input = $this->input;

        $this->quiet = $this->input->getOption('quiet');
        $this->noInteraction = $this->input->getOption('no-interaction');

        if ($this->noInteraction || $this->quiet) {
            $interactive = false;
        }

        if ($input->getOption('namespace')) {
            $this->namespace = trim($input->getOption('namespace'), '\\') . '\\';
        }

        if ($input->hasOption('actor') && $input->getOption('actor')) {
            $this->actorSuffix = $input->getOption('actor');
        }

        if ($interactive) {
            $this->askForAcknowledgment();
        }

        $this->say("<fg=white;bg=magenta> Bootstrapping Codeception for WordPress </fg=white;bg=magenta>\n");

        $this->createGlobalConfig();

        $this->say("File codeception.yml created       <- global configuration");

        $this->createDirs();

        if ($input->hasOption('empty') && $input->getOption('empty')) {
            return;
        }

        if ($interactive === null) {
            $this->say();
            $interactive = $this->ask('Would you like to set up the suites interactively now?', 'yes');
            $this->say(' --- ');
            $this->say();
            $interactive = preg_match('/^(n|N)/', $interactive) ? false : true;
        }

        $installationData = $this->getInstallationData($interactive);

        try {
            $this->creatEnvFile($installationData);
            $this->loadEnvFile();
            $this->createUnitSuite();
            $this->say("tests/unit created                 <- unit tests");
            $this->say("tests/unit.suite.yml written       <- unit tests suite configuration");
            $this->createWpUnitSuite(ucwords($installationData['wpunitSuite']), $installationData);
            $this->say("tests/{$installationData['wpunitSuiteSlug']} created               "
                       . '<- WordPress unit and integration tests');
            $this->say("tests/{$installationData['wpunitSuiteSlug']}.suite.yml written     "
                       . '<- WordPress unit and integration tests suite configuration');
            $this->createFunctionalSuite(ucwords($installationData['functionalSuite']), $installationData);
            $this->say("tests/{$installationData['functionalSuiteSlug']} created           "
                       . "<- {$installationData['functionalSuiteSlug']} tests");
            $this->say("tests/{$installationData['functionalSuiteSlug']}.suite.yml written "
                       . "<- {$installationData['functionalSuiteSlug']} tests suite configuration");
            $this->createAcceptanceSuite(ucwords($installationData['acceptanceSuite']), $installationData);
            $this->say("tests/{$installationData['acceptanceSuiteSlug']} created           "
                       . "<- {$installationData['acceptanceSuiteSlug']} tests");
            $this->say("tests/{$installationData['acceptanceSuiteSlug']}.suite.yml written "
                       . "<- {$installationData['acceptanceSuiteSlug']} tests suite configuration");
        } catch (ModuleConfigException $e) {
            $this->removeCreatedFiles();
            $this->say('<error>Something is not ok in the modules configurations: '
                       .'check your answers and try again.</error>');
            $this->say('<error>' . $e->getMessage() . '</error>');
            $this->sayInfo('All files and folders created by the initialization attempt have been removed.');

            return;
        }

        $this->say(" --- ");
        $this->say();
        if ($interactive) {
            $this->saySuccess("Codeception is installed for {$installationData['acceptanceSuiteSlug']}, "
                              . "{$installationData['functionalSuiteSlug']}, and WordPress unit testing");
        } else {
            $this->saySuccess("Codeception has created the files for the {$installationData['acceptanceSuiteSlug']}, "
                              . "{$installationData['functionalSuiteSlug']}, WordPress unit and unit suites "
                              . 'but the modules are not activated');
        }
        $this->say('Some commands have been added in the Codeception configuration file: '
                   .'check them out using <comment>codecept --help</comment>');
        $this->say(" --- ");
        $this->say();

        $this->say("<bold>Next steps:</bold>");
        $this->say('0. <bold>Create the databases used by the modules</bold>; wp-browser will not do it for you!');
        $this->say('1. <bold>Install and configure WordPress</bold> activating the theme and plugins you need to create'
                   . ' a database dump in <comment>tests/_data/dump.sql</comment>');
        $this->say("2. Edit <bold>tests/{$installationData['acceptanceSuiteSlug']}.suite.yml</bold> to make sure WPDb "
                   . 'and WPBrowser configurations match your local setup; change WPBrowser to WPWebDriver to '
                   . 'enable browser testing');
        $this->say("3. Edit <bold>tests/{$installationData['functionalSuiteSlug']}.suite.yml</bold> to make sure "
                   . 'WordPress and WPDb configurations match your local setup');
        $this->say("4. Edit <bold>tests/{$installationData['wpunitSuiteSlug']}.suite.yml</bold> to make sure WPLoader "
                   . 'configuration matches your local setup');
        $this->say("5. Create your first {$installationData['acceptanceSuiteSlug']} tests using <comment>codecept "
                   . "g:cest {$installationData['acceptanceSuiteSlug']} WPFirst</comment>");
        $this->say("6. Write a test in <bold>tests/{$installationData['acceptanceSuiteSlug']}/WPFirstCest.php</bold>");
        $this->say("7. Run tests using: <comment>codecept run {$installationData['acceptanceSuiteSlug']}</comment>");
        $this->say(" --- ");
        $this->say();
        $this->sayWarning('Please note: due to WordPress extended use of globals and constants you should avoid running'
                          . ' all the suites at the same time.');
        $this->say('Run each suite separately, like this: <comment>codecept run unit && codecept run '
                   . "{$installationData['wpunitSuiteSlug']}</comment>, to avoid problems.");
    }
1049359
public function getInterfaces()
    {
        $extendedInterfaces = [];
        $interfaces = parent::getInterfaces();
        foreach ($interfaces as $interface) {
            $extendedInterfaces[] = new ClassReflection($interface->getName());
        }
        return $extendedInterfaces;
    }
845517
protected function get_other_values(renderer_base $output) {
        $return = [];
        $cache = $this->related['cache'];

        $return['events'] = array_map(function($event) use ($cache, $output) {
            $context = $cache->get_context($event);
            $course = $cache->get_course($event);
            $exporter = new event_exporter($event, ['context' => $context, 'course' => $course]);

            return $exporter->export($output);
        }, $this->events);

        if ($count = count($return['events'])) {
            $return['firstid'] = $return['events'][0]->id;
            $return['lastid'] = $return['events'][$count - 1]->id;
        }

        return $return;
    }
213059
public function getChildren($id): array
    {
        $result = [];
        $childrenIds = (array)($this->childrenIds[$id] ?? []);
        foreach ($childrenIds as $childId) {
            if ($child = $this->getItem($childId)) {
                $result[$childId] = $child;
            }
        }
        return $result;
    }
201973
public function getGridOptions(): array
    {
        $collection = GridModel::findAll(['order' => 'tl_bs_grid.title']);
        $options    = [];

        if ($collection) {
            foreach ($collection as $model) {
                $parent = sprintf(
                    '%s [ID %s]',
                    $model->getRelated('pid')->name,
                    $model->pid
                );

                $options[$parent][$model->id] = sprintf('%s [ID %s]', $model->title, $model->id);
            }
        }

        return $options;
    }
442873
public function serializeDocument(DocumentInterface $document, bool $identifiersOnly = false): array
    {
        $result = [];

        if ($this->shouldContainData($document)) {
            $result['data'] = (!$document->shouldBeHandledAsCollection() && $document->data()->isEmpty()) ?
                null : $this->createData($document, $identifiersOnly);
        }

        if (!$document->metaInformation()->isEmpty()) {
            $result['meta'] = $document->metaInformation()->all();
        }

        if (!$document->links()->isEmpty()) {
            foreach ($document->links()->all() as $link) {
                $result['links'][$link->name()] = $this->serializeLink($link);
            }
        }

        if (!$document->included()->isEmpty()) {
            foreach ($document->included()->all() as $resource) {
                $result['included'][] = $this->serializeResource(
                    $resource,
                    false
                );
            }
        }

        if (!$document->errors()->isEmpty()) {
            foreach ($document->errors()->all() as $error) {
                $result['errors'][] = $this->serializeError($error);
            }
        }

        // informations about json api
        $result['jsonapi'] = [
            'version' => '1.0'
        ];

        return $result;
    }