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\Plugins\Tests; use PHPUnit\Framework\TestCase; class HideBloc..

Decoded Output download

<?php

namespace Roundcube\Plugins\Tests;

use PHPUnit\Framework\TestCase;

class HideBlockquoteTest extends TestCase
{
    /**
     * Plugin object construction test
     */
    public function test_constructor()
    {
        $rcube = 
cube::get_instance();
        $plugin = new \hide_blockquote($rcube->plugins);

        $this->assertInstanceOf('hide_blockquote', $plugin);
        $this->assertInstanceOf('rcube_plugin', $plugin);

        $plugin->init();
    }

    /**
     * Test prefs_table() method
     */
    public function test_prefs_table()
    {
        $rcube = 
cube::get_instance();
        $plugin = new \hide_blockquote($rcube->plugins);

        $args = ['section' => 'mailview', 'blocks' => ['main' => ['options' => []]]];

        $result = $plugin->prefs_table($args);

        $this->assertSame(
            '<label for="hide_blockquote_limit">Hide citation when lines count is greater than</label>',
            $result['blocks']['main']['options']['hide_blockquote_limit']['title']
        );

        $this->assertSame(
            '<input name="_hide_blockquote_limit" id="hide_blockquote_limit" size="5" class="form-control" value="" type="text">',
            $result['blocks']['main']['options']['hide_blockquote_limit']['content']
        );
    }

    /**
     * Test prefs_save() method
     */
    public function test_prefs_save()
    {
        $rcube = 
cube::get_instance();
        $plugin = new \hide_blockquote($rcube->plugins);

        $_POST = [];
        $args = ['section' => 'mailview', 'prefs' => []];

        $result = $plugin->prefs_save($args);

        $this->assertSame(0, $result['prefs']['hide_blockquote_limit']);

        $_POST = ['_hide_blockquote_limit' => '10'];
        $args = ['section' => 'mailview', 'prefs' => []];

        $result = $plugin->prefs_save($args);

        $this->assertSame(10, $result['prefs']['hide_blockquote_limit']);
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

namespace Roundcube\Plugins\Tests;

use PHPUnit\Framework\TestCase;

class HideBlockquoteTest extends TestCase
{
    /**
     * Plugin object construction test
     */
    public function test_constructor()
    {
        $rcube = \rcube::get_instance();
        $plugin = new \hide_blockquote($rcube->plugins);

        $this->assertInstanceOf('hide_blockquote', $plugin);
        $this->assertInstanceOf('rcube_plugin', $plugin);

        $plugin->init();
    }

    /**
     * Test prefs_table() method
     */
    public function test_prefs_table()
    {
        $rcube = \rcube::get_instance();
        $plugin = new \hide_blockquote($rcube->plugins);

        $args = ['section' => 'mailview', 'blocks' => ['main' => ['options' => []]]];

        $result = $plugin->prefs_table($args);

        $this->assertSame(
            '<label for="hide_blockquote_limit">Hide citation when lines count is greater than</label>',
            $result['blocks']['main']['options']['hide_blockquote_limit']['title']
        );

        $this->assertSame(
            '<input name="_hide_blockquote_limit" id="hide_blockquote_limit" size="5" class="form-control" value="" type="text">',
            $result['blocks']['main']['options']['hide_blockquote_limit']['content']
        );
    }

    /**
     * Test prefs_save() method
     */
    public function test_prefs_save()
    {
        $rcube = \rcube::get_instance();
        $plugin = new \hide_blockquote($rcube->plugins);

        $_POST = [];
        $args = ['section' => 'mailview', 'prefs' => []];

        $result = $plugin->prefs_save($args);

        $this->assertSame(0, $result['prefs']['hide_blockquote_limit']);

        $_POST = ['_hide_blockquote_limit' => '10'];
        $args = ['section' => 'mailview', 'prefs' => []];

        $result = $plugin->prefs_save($args);

        $this->assertSame(10, $result['prefs']['hide_blockquote_limit']);
    }
}

Function Calls

None

Variables

None

Stats

MD5 c8434d38b8fe5bd6fa2d931e0bcd6faa
Eval Count 0
Decode Time 88 ms