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 declare(strict_types=1); /** * Passbolt ~ Open source password manager for teams ..

Decoded Output download

<?php
declare(strict_types=1);

/**
 * Passbolt ~ Open source password manager for teams
 * Copyright (c) Passbolt SA (https://www.passbolt.com)
 *
 * Licensed under GNU Affero General Public License version 3 of the or any later version.
 * For full copyright and license information, please see the LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright (c) Passbolt SA (https://www.passbolt.com)
 * @license       https://opensource.org/licenses/AGPL-3.0 AGPL License
 * @link          https://www.passbolt.com Passbolt(tm)
 * @since         4.7.0
 */

namespace Passbolt\EmailNotificationSettings\Test\TestCase\Controllers;

use App\Test\Lib\AppIntegrationTestCase;
use Passbolt\EmailNotificationSettings\Test\Factory\EmailNotificationSettingFactory;

class EmailNotificationSettingsBasicActionsControllerTest extends AppIntegrationTestCase
{
    public function testEmailNotificationSettingsBasicActionsController_View_Settings_On_Invalid_Email_Settings(): void
    {
        $invalidJsonString = '{foo: ';
        EmailNotificationSettingFactory::make()->setField('value', $invalidJsonString)->persist();
        $this->get('/settings.json');
        $this->assertResponseOk();
    }

    public function testEmailNotificationSettingsBasicActionsController_View_Avatar_On_Invalid_Email_Settings(): void
    {
        $invalidJsonString = '{foo: ';
        EmailNotificationSettingFactory::make()->setField('value', $invalidJsonString)->persist();
        $this->get('/avatars/view/75dc2799-a85c-47c1-8dff-c4ab3efb19ca/small.jpg');
        $this->assertResponseOk();
    }

    /**
     * This action triggers an email. Therefore, if the settings in the DB are not consistent, an error
     * is triggered
     */
    public function testEmailNotificationSettingsBasicActionsController_Create_Resource_On_Invalid_Email_Settings(): void
    {
        $invalidJsonString = '{foo: ';
        EmailNotificationSettingFactory::make()->setField('value', $invalidJsonString)->persist();

        $this->logInAsUser();
        $data = $this->getDummyResourcesPostData([
            'name' => '',
            'username' => '[email protected]',
            'uri' => 'https://www..com',
            'description' => '',
        ]);
        $this->postJson('/resources.json', $data);
        $this->assertResponseError('Could not validate resource data.');
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php
declare(strict_types=1);

/**
 * Passbolt ~ Open source password manager for teams
 * Copyright (c) Passbolt SA (https://www.passbolt.com)
 *
 * Licensed under GNU Affero General Public License version 3 of the or any later version.
 * For full copyright and license information, please see the LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright (c) Passbolt SA (https://www.passbolt.com)
 * @license       https://opensource.org/licenses/AGPL-3.0 AGPL License
 * @link          https://www.passbolt.com Passbolt(tm)
 * @since         4.7.0
 */

namespace Passbolt\EmailNotificationSettings\Test\TestCase\Controllers;

use App\Test\Lib\AppIntegrationTestCase;
use Passbolt\EmailNotificationSettings\Test\Factory\EmailNotificationSettingFactory;

class EmailNotificationSettingsBasicActionsControllerTest extends AppIntegrationTestCase
{
    public function testEmailNotificationSettingsBasicActionsController_View_Settings_On_Invalid_Email_Settings(): void
    {
        $invalidJsonString = '{foo: ';
        EmailNotificationSettingFactory::make()->setField('value', $invalidJsonString)->persist();
        $this->get('/settings.json');
        $this->assertResponseOk();
    }

    public function testEmailNotificationSettingsBasicActionsController_View_Avatar_On_Invalid_Email_Settings(): void
    {
        $invalidJsonString = '{foo: ';
        EmailNotificationSettingFactory::make()->setField('value', $invalidJsonString)->persist();
        $this->get('/avatars/view/75dc2799-a85c-47c1-8dff-c4ab3efb19ca/small.jpg');
        $this->assertResponseOk();
    }

    /**
     * This action triggers an email. Therefore, if the settings in the DB are not consistent, an error
     * is triggered
     */
    public function testEmailNotificationSettingsBasicActionsController_Create_Resource_On_Invalid_Email_Settings(): void
    {
        $invalidJsonString = '{foo: ';
        EmailNotificationSettingFactory::make()->setField('value', $invalidJsonString)->persist();

        $this->logInAsUser();
        $data = $this->getDummyResourcesPostData([
            'name' => '',
            'username' => '[email protected]',
            'uri' => 'https://www..com',
            'description' => '',
        ]);
        $this->postJson('/resources.json', $data);
        $this->assertResponseError('Could not validate resource data.');
    }
}

Function Calls

None

Variables

None

Stats

MD5 d6935c3fcf2a399f934f49d147e7606b
Eval Count 0
Decode Time 83 ms