Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php namespace Roundcube\Tests\Actions\Utils; use Roundcube\Tests\ActionTestCase; use R..

Decoded Output download

<?php

namespace Roundcube\Tests\Actions\Utils;

use Roundcube\Tests\ActionTestCase;
use Roundcube\Tests\OutputHtmlMock;

/**
 * Test class to test rcmail_action_utils_text2html
 */
class Text2htmlTest extends ActionTestCase
{
    /**
     * Class constructor
     */
    public function test_class()
    {
        $object = new \rcmail_action_utils_text2html();

        $this->assertInstanceOf(\rcmail_action::class, $object);
    }

    /**
     * Test for run()
     */
    public function test_run()
    {
        $object = new \rcmail_action_utils_text2html();
        $input = 'test plain text input';
        $object::$source = $this->createTempFile($input);

        $output = $this->initOutput(\rcmail_action::MODE_HTTP, 'utils', 'text2html');

        $this->assertTrue($object->checks());

        $this->runAndAssert($object, OutputHtmlMock::E_EXIT);

        $this->assertSame('<div class="pre">test plain text input</div>', $output->output);
        $this->assertSame(['Content-Type: text/html; charset=UTF-8'], $output->headers);
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

namespace Roundcube\Tests\Actions\Utils;

use Roundcube\Tests\ActionTestCase;
use Roundcube\Tests\OutputHtmlMock;

/**
 * Test class to test rcmail_action_utils_text2html
 */
class Text2htmlTest extends ActionTestCase
{
    /**
     * Class constructor
     */
    public function test_class()
    {
        $object = new \rcmail_action_utils_text2html();

        $this->assertInstanceOf(\rcmail_action::class, $object);
    }

    /**
     * Test for run()
     */
    public function test_run()
    {
        $object = new \rcmail_action_utils_text2html();
        $input = 'test plain text input';
        $object::$source = $this->createTempFile($input);

        $output = $this->initOutput(\rcmail_action::MODE_HTTP, 'utils', 'text2html');

        $this->assertTrue($object->checks());

        $this->runAndAssert($object, OutputHtmlMock::E_EXIT);

        $this->assertSame('<div class="pre">test plain text input</div>', $output->output);
        $this->assertSame(['Content-Type: text/html; charset=UTF-8'], $output->headers);
    }
}

Function Calls

None

Variables

None

Stats

MD5 e779ddee5f2187ae26f28ccb30cf55f1
Eval Count 0
Decode Time 95 ms