N98\Magento\Command\LocalConfig\GenerateCommandTest::testCdataTagIsNotAddedIfPresentInInput PHP Метод

testCdataTagIsNotAddedIfPresentInInput() публичный Метод

    public function testCdataTagIsNotAddedIfPresentInInput()
    {
        $command = $this->getApplication()->find('local-config:generate');
        $dialog = $this->getMock('Symfony\\Component\\Console\\Helper\\DialogHelper', array('ask'));
        $dialog->expects($this->once())->method('ask')->with($this->isInstanceOf('Symfony\\Component\\Console\\Output\\StreamOutput'), '<question>Please enter the database host:</question>')->will($this->returnValue('CDATAdatabasehost'));
        $command->getHelperSet()->set($dialog, 'dialog');
        $commandTester = new CommandTester($command);
        $commandTester->execute(array('command' => $command->getName(), 'db-user' => 'my_db_user', 'db-pass' => 'my_db_pass', 'db-name' => 'my_db_name', 'session-save' => 'my_session_save', 'admin-frontname' => 'my_admin_frontname', 'encryption-key' => 'key123456789'));
        $this->assertFileExists($this->configFile);
        $fileContent = \file_get_contents($this->configFile);
        $this->assertContains('<host><![CDATA[CDATAdatabasehost]]></host>', $fileContent);
        $this->assertContains('<username><![CDATA[my_db_user]]></username>', $fileContent);
        $this->assertContains('<password><![CDATA[my_db_pass]]></password>', $fileContent);
        $this->assertContains('<dbname><![CDATA[my_db_name]]></dbname>', $fileContent);
        $this->assertContains('<session_save><![CDATA[my_session_save]]></session_save>', $fileContent);
        $this->assertContains('<frontName><![CDATA[my_admin_frontname]]></frontName>', $fileContent);
        $this->assertContains('<key><![CDATA[key123456789]]></key>', $fileContent);
        $xml = \simplexml_load_file($this->configFile);
        $this->assertNotInternalType('bool', $xml);
    }