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 /** * This file is part of the Cloudinary PHP package. * * (c) Cloudinary * * F..

Decoded Output download

<?php
/**
 * This file is part of the Cloudinary PHP package.
 *
 * (c) Cloudinary
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Cloudinary\Test\Unit\Configuration;

use Cloudinary\Configuration\CloudConfig;
use Cloudinary\Test\Unit\UnitTestCase;

/**
 * Class SensitiveKeysSerializationTest
 */
class SensitiveKeysSerializationTest extends UnitTestCase
{
    private $cloud;

    public function setUp()
    {
        parent::setUp();

        $this->cloud = CloudConfig::fromCloudinaryUrl($this->cloudinaryUrl);
    }

    public function testExcludedKeysAreNotSerialized()
    {
        self::assertStrEquals(
            'cloud[cloud_name]=test123&cloud[api_key]=' . self::API_KEY,
            $this->cloud->toString([CloudConfig::API_SECRET])
        );

        self::assertStrEquals(
            'cloud[cloud_name]=test123&cloud[api_key]=' . self::API_KEY . '&cloud[api_secret]=' . self::API_SECRET,
            $this->cloud->toString()
        );
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php
/**
 * This file is part of the Cloudinary PHP package.
 *
 * (c) Cloudinary
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Cloudinary\Test\Unit\Configuration;

use Cloudinary\Configuration\CloudConfig;
use Cloudinary\Test\Unit\UnitTestCase;

/**
 * Class SensitiveKeysSerializationTest
 */
class SensitiveKeysSerializationTest extends UnitTestCase
{
    private $cloud;

    public function setUp()
    {
        parent::setUp();

        $this->cloud = CloudConfig::fromCloudinaryUrl($this->cloudinaryUrl);
    }

    public function testExcludedKeysAreNotSerialized()
    {
        self::assertStrEquals(
            'cloud[cloud_name]=test123&cloud[api_key]=' . self::API_KEY,
            $this->cloud->toString([CloudConfig::API_SECRET])
        );

        self::assertStrEquals(
            'cloud[cloud_name]=test123&cloud[api_key]=' . self::API_KEY . '&cloud[api_secret]=' . self::API_SECRET,
            $this->cloud->toString()
        );
    }
}

Function Calls

None

Variables

None

Stats

MD5 af336ce412b8055cf84591d727084004
Eval Count 0
Decode Time 105 ms