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 Phalcon Framework. * * (c) Phalcon Team <team@pha..

Decoded Output download

<?php

/**
 * This file is part of the Phalcon Framework.
 *
 * (c) Phalcon Team <[email protected]>
 *
 * For the full copyright and license information, please view the LICENSE.txt
 * file that was distributed with this source code.
 */

declare(strict_types=1);

namespace Phalcon\Tests\Unit\Http\Response;

use Phalcon\Http\Response;
use Phalcon\Http\Response\Cookies;
use Phalcon\Tests\Fixtures\Traits\DiTrait;
use UnitTester;

class GetSetCookiesCest
{
    use DiTrait;

    /**
     * Tests Phalcon\Http\Response :: getCookies() / setCookies()
     *
     * @author Jeremy PASTOURET <https://github.com/jenovateurs>
     * @since  2019-12-08
     */
    public function httpResponseGetSetCookies(UnitTester $I)
    {
        $I->wantToTest('Http\Response - getCookies() / setCookies');

        $this->setNewFactoryDefault();

        $oCookies = new Cookies();
        $oCookies->setDI($this->container);
        $oCookies->set('firstname', 'jeremy');

        $oResponse = new Response();
        $oResponse->setCookies($oCookies);

        $I->assertSame(
            $oCookies,
            $oResponse->getCookies()
        );
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

/**
 * This file is part of the Phalcon Framework.
 *
 * (c) Phalcon Team <[email protected]>
 *
 * For the full copyright and license information, please view the LICENSE.txt
 * file that was distributed with this source code.
 */

declare(strict_types=1);

namespace Phalcon\Tests\Unit\Http\Response;

use Phalcon\Http\Response;
use Phalcon\Http\Response\Cookies;
use Phalcon\Tests\Fixtures\Traits\DiTrait;
use UnitTester;

class GetSetCookiesCest
{
    use DiTrait;

    /**
     * Tests Phalcon\Http\Response :: getCookies() / setCookies()
     *
     * @author Jeremy PASTOURET <https://github.com/jenovateurs>
     * @since  2019-12-08
     */
    public function httpResponseGetSetCookies(UnitTester $I)
    {
        $I->wantToTest('Http\Response - getCookies() / setCookies');

        $this->setNewFactoryDefault();

        $oCookies = new Cookies();
        $oCookies->setDI($this->container);
        $oCookies->set('firstname', 'jeremy');

        $oResponse = new Response();
        $oResponse->setCookies($oCookies);

        $I->assertSame(
            $oCookies,
            $oResponse->getCookies()
        );
    }
}

Function Calls

None

Variables

None

Stats

MD5 cab4f771890f7de50931a1f73e99fe23
Eval Count 0
Decode Time 79 ms