Redaxscript\Tests\Controller\InstallTest::testProcess PHP Method

testProcess() public method

testProcess
Since: 3.0.0
public testProcess ( array $postArray = [], string $expect = null )
$postArray array
$expect string
    public function testProcess($postArray = [], $expect = null)
    {
        /* setup */
        $postArray['db-type'] = $postArray['db-type'] === '%CURRENT%' ? $this->_config->get('dbType') : $postArray['db-type'];
        $postArray['db-host'] = $postArray['db-host'] === '%CURRENT%' ? $this->_config->get('dbHost') : $postArray['db-host'];
        $postArray['db-name'] = $postArray['db-name'] === '%CURRENT%' ? $this->_config->get('dbName') : $postArray['db-name'];
        $postArray['db-user'] = $postArray['db-user'] === '%CURRENT%' ? $this->_config->get('dbUser') : $postArray['db-user'];
        $postArray['db-password'] = $postArray['db-password'] === '%CURRENT%' ? $this->_config->get('dbPassword') : $postArray['db-password'];
        $postArray['db-prefix'] = $postArray['db-prefix'] === '%CURRENT%' ? $this->_config->get('dbPrefix') : $postArray['db-prefix'];
        $this->_request->set('post', $postArray);
        $this->_config->init(Stream::url('root/config.php'));
        $controllerInstall = new Controller\Install($this->_registry, $this->_language, $this->_request, $this->_config);
        /* actual */
        $actual = $controllerInstall->process();
        /* compare */
        $this->assertEquals($expect, $actual);
    }