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         2.5.0
 */
namespace Passbolt\WebInstaller\Test\TestCase\Controller;

use Passbolt\WebInstaller\Test\Lib\WebInstallerIntegrationTestCase;

class AccountCreationControllerTest extends WebInstallerIntegrationTestCase
{
    public function setUp(): void
    {
        parent::setUp();
        $this->mockPassboltIsNotconfigured();
        $this->initWebInstallerSession(['database' => $this->getTestDatasourceFromConfig()]);
    }

    public function testWebInstallerAccountCreationViewSuccess()
    {
        $this->get('/install/account_creation');
        $data = $this->_getBodyAsString();
        $this->assertResponseOk();
        $this->assertStringContainsString('Admin user details', $data);
    }

    public function testWebInstallerAccountCreationPostSuccess()
    {
        $postData = [
            'username' => '[email protected]',
            'first_name' => 'Aurore',
            'last_name' => 'Avargus-Weber',
        ];
        $this->post('/install/account_creation', $postData);
        $this->assertResponseCode(302);
        $this->assertRedirectContains('install/installation');

        $expectedData = [
            'username' => '[email protected]',
            'profile' => [
                'first_name' => 'Aurore',
                'last_name' => 'Avargus-Weber',
            ],
        ];
        $this->assertSession($expectedData, 'webinstaller.first_user');
    }

    public function testWebInstallerAccountCreationPostError_InvalidData()
    {
        $postData = [
            'username' => 'invalid-email',
            'first_name' => 'Aurore',
            'last_name' => 'Avargus-Weber',
        ];
        $this->post('/install/account_creation', $postData);
        $data = $this->_getBodyAsString();
        $this->assertResponseOk();
        $this->assertStringContainsString('The data entered are not correct', $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         2.5.0
 */
namespace Passbolt\WebInstaller\Test\TestCase\Controller;

use Passbolt\WebInstaller\Test\Lib\WebInstallerIntegrationTestCase;

class AccountCreationControllerTest extends WebInstallerIntegrationTestCase
{
    public function setUp(): void
    {
        parent::setUp();
        $this->mockPassboltIsNotconfigured();
        $this->initWebInstallerSession(['database' => $this->getTestDatasourceFromConfig()]);
    }

    public function testWebInstallerAccountCreationViewSuccess()
    {
        $this->get('/install/account_creation');
        $data = $this->_getBodyAsString();
        $this->assertResponseOk();
        $this->assertStringContainsString('Admin user details', $data);
    }

    public function testWebInstallerAccountCreationPostSuccess()
    {
        $postData = [
            'username' => '[email protected]',
            'first_name' => 'Aurore',
            'last_name' => 'Avargus-Weber',
        ];
        $this->post('/install/account_creation', $postData);
        $this->assertResponseCode(302);
        $this->assertRedirectContains('install/installation');

        $expectedData = [
            'username' => '[email protected]',
            'profile' => [
                'first_name' => 'Aurore',
                'last_name' => 'Avargus-Weber',
            ],
        ];
        $this->assertSession($expectedData, 'webinstaller.first_user');
    }

    public function testWebInstallerAccountCreationPostError_InvalidData()
    {
        $postData = [
            'username' => 'invalid-email',
            'first_name' => 'Aurore',
            'last_name' => 'Avargus-Weber',
        ];
        $this->post('/install/account_creation', $postData);
        $data = $this->_getBodyAsString();
        $this->assertResponseOk();
        $this->assertStringContainsString('The data entered are not correct', $data);
    }
}

Function Calls

None

Variables

None

Stats

MD5 becf5e0255e323c0cf2b7c9d65b98430
Eval Count 0
Decode Time 124 ms