Welcome To Our Shell

Mister Spy & Souheyl Bypass Shell

Current Path : /var/www/html/musik/vendor/symfony-cmf/routing/tests/Unit/Enhancer/

Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
Upload File :
Current File : /var/www/html/musik/vendor/symfony-cmf/routing/tests/Unit/Enhancer/RouteContentEnhancerTest.php

<?php

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

namespace Symfony\Cmf\Component\Routing\Tests\Unit\Enhancer;

use PHPUnit\Framework\TestCase;
use Symfony\Cmf\Component\Routing\Enhancer\RouteContentEnhancer;
use Symfony\Cmf\Component\Routing\RouteObjectInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Route;

class RouteContentEnhancerTest extends TestCase
{
    /**
     * @var RouteContentEnhancer
     */
    private $mapper;

    private $document;

    private $request;

    public function setUp(): void
    {
        $this->document = $this->createMock(RouteObject::class);

        $this->mapper = new RouteContentEnhancer(RouteObjectInterface::ROUTE_OBJECT, '_content');

        $this->request = Request::create('/test');
    }

    public function testContent()
    {
        $targetDocument = new TargetDocument();
        $this->document->expects($this->once())
            ->method('getContent')
            ->will($this->returnValue($targetDocument));

        $defaults = [RouteObjectInterface::ROUTE_OBJECT => $this->document];
        $expected = [RouteObjectInterface::ROUTE_OBJECT => $this->document, '_content' => $targetDocument];

        $this->assertEquals($expected, $this->mapper->enhance($defaults, $this->request));
    }

    public function testFieldAlreadyThere()
    {
        $this->document->expects($this->never())
            ->method('getContent')
        ;

        $defaults = [RouteObjectInterface::ROUTE_OBJECT => $this->document, '_content' => 'foo'];

        $this->assertEquals($defaults, $this->mapper->enhance($defaults, $this->request));
    }

    public function testNoContent()
    {
        $this->document->expects($this->once())
            ->method('getContent')
            ->will($this->returnValue(null));

        $defaults = [RouteObjectInterface::ROUTE_OBJECT => $this->document];
        $this->assertEquals($defaults, $this->mapper->enhance($defaults, $this->request));
    }

    public function testNoCmfRoute()
    {
        $defaults = [RouteObjectInterface::ROUTE_OBJECT => $this->createMock(Route::class)];
        $this->assertEquals($defaults, $this->mapper->enhance($defaults, $this->request));
    }
}

class TargetDocument
{
}

class UnknownDocument
{
}

bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped)
Email: contact@elmoujehidin.net bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped) Email: contact@elmoujehidin.net