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

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

public wrapCdata ( )
    public function wrapCdata()
    {
        $command = new GenerateCommand();
        $refl = new \ReflectionClass($command);
        $method = $refl->getMethod('_wrapCData');
        $method->setAccessible(true);
        $sujet = function ($string) use($method, $command) {
            return $method->invoke($command, $string);
        };
        $this->assertSame('', $sujet(null));
        $this->assertSame('<![CDATA[CDATA]]>', $sujet('CDATA'));
        $this->assertSame('<![CDATA[]]]]>', $sujet(']]'));
        $this->assertSame('<![CDATA[ with terminator "]]>]]&gt;<![CDATA[" inside ]]>', $sujet(' with terminator "]]>" inside '));
        $this->assertSame(']]&gt;<![CDATA[ at the start ]]>', $sujet(']]> at the start '));
        $this->assertSame('<![CDATA[ at the end ]]>]]&gt;', $sujet(' at the end ]]>'));
    }