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\Browser\Mail; use Roundcube\Tests\Browser\Bootstrap; use..

Decoded Output download

<?php

namespace Roundcube\Tests\Browser\Mail;

use Roundcube\Tests\Browser\Bootstrap;
use Roundcube\Tests\Browser\Components\App;
use Roundcube\Tests\Browser\Components\Popupmenu;
use Roundcube\Tests\Browser\TestCase;

class PrintTest extends TestCase
{
    #[\Override]
    public static function setUpBeforeClass(): void
    {
        Bootstrap::init_imap(true);
        Bootstrap::purge_mailbox('INBOX');

        // import email messages
        foreach (glob(TESTS_DIR . 'data/mail/list_00.eml') as $f) {
            Bootstrap::import_message($f, 'INBOX');
        }
    }

    /**
     * Test Print action
     */
    public function testPrint()
    {
        $this->browse(function ($browser) {
            $browser->go('mail');

            $browser->waitFor('#messagelist tbody tr:first-child')
                ->ctrlClick('#messagelist tbody tr:first-child');

            $browser->clickToolbarMenuItem('more', null, false);

            $browser->with(new Popupmenu('message-menu'), function ($browser) use (&$current_window, &$new_window) {
                if ($browser->isPhone()) {
                    $browser->assertMissing('a.print');
                    $this->markTestSkipped();
                }

                [$current_window, $new_window] = $browser->openWindow(static function ($browser) {
                    $browser->clickMenuItem('print');
                });
            });

            $browser->driver->switchTo()->window($new_window);

            $browser->with(new App(), static function ($browser) {
                $browser->assertEnv([
                    'task' => 'mail',
                    'action' => 'print',
                ]);
            });

            $browser->assertVisible('img.contactphoto')
                ->assertSeeIn('.subject', 'Lines')
                ->assertSeeIn('.message-part div.pre', 'Plain text message body.')
                ->assertVisible('.message-part div.pre .sig')
                // Tests "more recipients" link
                ->with('.header-headers .header.cc', static function ($browser) {
                    $browser->assertSee('[email protected]')
                        ->assertDontSee('[email protected]')
                        ->assertSeeIn('a.morelink', '2 more...')
                        ->assertElementsCount('span.adr', 10)
                        ->click('a.morelink')
                        ->assertElementsCount('span.adr', 12)
                        ->assertSee('[email protected]');
                });

            $browser->driver->close();
            $browser->driver->switchTo()->window($current_window);
        });
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

namespace Roundcube\Tests\Browser\Mail;

use Roundcube\Tests\Browser\Bootstrap;
use Roundcube\Tests\Browser\Components\App;
use Roundcube\Tests\Browser\Components\Popupmenu;
use Roundcube\Tests\Browser\TestCase;

class PrintTest extends TestCase
{
    #[\Override]
    public static function setUpBeforeClass(): void
    {
        Bootstrap::init_imap(true);
        Bootstrap::purge_mailbox('INBOX');

        // import email messages
        foreach (glob(TESTS_DIR . 'data/mail/list_00.eml') as $f) {
            Bootstrap::import_message($f, 'INBOX');
        }
    }

    /**
     * Test Print action
     */
    public function testPrint()
    {
        $this->browse(function ($browser) {
            $browser->go('mail');

            $browser->waitFor('#messagelist tbody tr:first-child')
                ->ctrlClick('#messagelist tbody tr:first-child');

            $browser->clickToolbarMenuItem('more', null, false);

            $browser->with(new Popupmenu('message-menu'), function ($browser) use (&$current_window, &$new_window) {
                if ($browser->isPhone()) {
                    $browser->assertMissing('a.print');
                    $this->markTestSkipped();
                }

                [$current_window, $new_window] = $browser->openWindow(static function ($browser) {
                    $browser->clickMenuItem('print');
                });
            });

            $browser->driver->switchTo()->window($new_window);

            $browser->with(new App(), static function ($browser) {
                $browser->assertEnv([
                    'task' => 'mail',
                    'action' => 'print',
                ]);
            });

            $browser->assertVisible('img.contactphoto')
                ->assertSeeIn('.subject', 'Lines')
                ->assertSeeIn('.message-part div.pre', 'Plain text message body.')
                ->assertVisible('.message-part div.pre .sig')
                // Tests "more recipients" link
                ->with('.header-headers .header.cc', static function ($browser) {
                    $browser->assertSee('[email protected]')
                        ->assertDontSee('[email protected]')
                        ->assertSeeIn('a.morelink', '2 more...')
                        ->assertElementsCount('span.adr', 10)
                        ->click('a.morelink')
                        ->assertElementsCount('span.adr', 12)
                        ->assertSee('[email protected]');
                });

            $browser->driver->close();
            $browser->driver->switchTo()->window($current_window);
        });
    }
}

Function Calls

None

Variables

None

Stats

MD5 d365d8e309e473fe1991c01e3fc2cbd2
Eval Count 0
Decode Time 52 ms