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 namespace phpDocumentor\Reflection\DocBlock\Tags; use Mockery as m; use phpDocumen..
Decoded Output download
<?php
namespace phpDocumentor\Reflection\DocBlock\Tags; use Mockery as m; use phpDocumentor\Reflection\DocBlock\Description; use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\DocBlock\StandardTagFactory; use phpDocumentor\Reflection\FqsenResolver; use phpDocumentor\Reflection\TypeResolver; use phpDocumentor\Reflection\Types\Context; use phpDocumentor\Reflection\Types\Integer; use phpDocumentor\Reflection\Types\String_; use PHPUnit\Framework\TestCase; class PropertyReadTest extends TestCase { public function tearDown() : void { m::close(); } public function testIfCorrectTagNameIsReturned() : void { $fixture = new PropertyRead("myProperty", null, new Description("Description")); $this->assertSame("property-read", $fixture->getName()); } public function testIfTagCanBeRenderedUsingDefaultFormatter() : void { $fixture = new PropertyRead("myProperty", new String_(), new Description("Description")); $this->assertSame("@property-read string $myProperty Description", $fixture->render()); $fixture = new PropertyRead("myProperty", null, new Description("Description")); $this->assertSame("@property-read $myProperty Description", $fixture->render()); $fixture = new PropertyRead("myProperty"); $this->assertSame("@property-read $myProperty", $fixture->render()); } public function testIfTagCanBeRenderedUsingSpecificFormatter() : void { $fixture = new PropertyRead("myProperty"); $formatter = m::mock(Formatter::class); $formatter->shouldReceive("format")->with($fixture)->andReturn("Rendered output"); $this->assertSame("Rendered output", $fixture->render($formatter)); } public function testHasVariableName() : void { $expected = "myProperty"; $fixture = new PropertyRead($expected); $this->assertSame($expected, $fixture->getVariableName()); } public function testHasType() : void { $expected = new String_(); $fixture = new PropertyRead("myProperty", $expected); $this->assertSame($expected, $fixture->getType()); } public function testHasDescription() : void { $expected = new Description("Description"); $fixture = new PropertyRead("1.0", null, $expected); $this->assertSame($expected, $fixture->getDescription()); } public function testStringRepresentationIsReturned() : void { $fixture = new PropertyRead("myProperty", new String_(), new Description("Description")); $this->assertSame("string $myProperty Description", (string) $fixture); } public function testFactoryMethod() : void { $typeResolver = new TypeResolver(); $descriptionFactory = m::mock(DescriptionFactory::class); $context = new Context(''); $description = new Description("My Description"); $descriptionFactory->shouldReceive("create")->with("My Description", $context)->andReturn($description); $fixture = PropertyRead::create("string $myProperty My Description", $typeResolver, $descriptionFactory, $context); $this->assertSame("string $myProperty My Description", (string) $fixture); $this->assertSame("myProperty", $fixture->getVariableName()); $this->assertInstanceOf(String_::class, $fixture->getType()); $this->assertSame($description, $fixture->getDescription()); } public function testFactoryMethodWithoutType() : void { $typeResolver = new TypeResolver(); $fqsenResolver = new FqsenResolver(); $tagFactory = new StandardTagFactory($fqsenResolver); $descriptionFactory = new DescriptionFactory($tagFactory); $context = new Context(''); $fixture = PropertyRead::create("$myParameter My Description", $typeResolver, $descriptionFactory, $context); $this->assertSame("$myParameter My Description", (string) $fixture); $this->assertSame("myParameter", $fixture->getVariableName()); $this->assertNull($fixture->getType()); $this->assertSame("My Description", $fixture->getDescription() . ''); } public function testFactoryMethodWithType() : void { $typeResolver = new TypeResolver(); $fqsenResolver = new FqsenResolver(); $tagFactory = new StandardTagFactory($fqsenResolver); $descriptionFactory = new DescriptionFactory($tagFactory); $context = new Context(''); $fixture = PropertyRead::create("int My Description", $typeResolver, $descriptionFactory, $context); $this->assertSame("int My Description", (string) $fixture); $this->assertSame('', $fixture->getVariableName()); $this->assertInstanceOf(Integer::class, $fixture->getType()); $this->assertSame("My Description", $fixture->getDescription() . ''); } public function testFactoryMethodFailsIfEmptyBodyIsGiven() : void { $this->expectException("InvalidArgumentException"); $descriptionFactory = m::mock(DescriptionFactory::class); PropertyRead::create('', new TypeResolver(), $descriptionFactory); } public function testFactoryMethodFailsIfResolverIsNull() : void { $this->expectException("InvalidArgumentException"); PropertyRead::create("body"); } public function testFactoryMethodFailsIfDescriptionFactoryIsNull() : void { $this->expectException("InvalidArgumentException"); PropertyRead::create("body", new TypeResolver()); } } ?>
Did this file decode correctly?
Original Code
<?php
namespace phpDocumentor\Reflection\DocBlock\Tags; use Mockery as m; use phpDocumentor\Reflection\DocBlock\Description; use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\DocBlock\StandardTagFactory; use phpDocumentor\Reflection\FqsenResolver; use phpDocumentor\Reflection\TypeResolver; use phpDocumentor\Reflection\Types\Context; use phpDocumentor\Reflection\Types\Integer; use phpDocumentor\Reflection\Types\String_; use PHPUnit\Framework\TestCase; class PropertyReadTest extends TestCase { public function tearDown() : void { m::close(); } public function testIfCorrectTagNameIsReturned() : void { $fixture = new PropertyRead("\155\x79\x50\162\x6f\160\145\x72\x74\171", null, new Description("\x44\145\x73\x63\162\151\160\x74\x69\157\156")); $this->assertSame("\x70\162\157\160\x65\162\x74\x79\55\162\x65\x61\x64", $fixture->getName()); } public function testIfTagCanBeRenderedUsingDefaultFormatter() : void { $fixture = new PropertyRead("\x6d\171\120\x72\x6f\160\x65\162\164\171", new String_(), new Description("\104\x65\163\x63\162\151\160\164\x69\157\x6e")); $this->assertSame("\x40\160\x72\157\160\x65\162\164\x79\55\x72\145\141\x64\x20\x73\x74\x72\151\x6e\x67\40\44\155\x79\x50\x72\157\x70\x65\x72\164\171\x20\104\x65\x73\143\162\x69\160\x74\151\x6f\x6e", $fixture->render()); $fixture = new PropertyRead("\x6d\x79\x50\x72\x6f\x70\145\x72\164\171", null, new Description("\x44\x65\163\x63\x72\151\x70\x74\151\x6f\x6e")); $this->assertSame("\x40\160\x72\x6f\160\145\162\164\171\55\162\x65\x61\144\40\44\155\171\120\x72\x6f\160\145\x72\164\171\40\x44\x65\163\x63\x72\x69\x70\164\151\157\156", $fixture->render()); $fixture = new PropertyRead("\x6d\x79\120\162\x6f\160\x65\x72\164\171"); $this->assertSame("\x40\x70\162\157\x70\145\x72\164\171\55\162\145\x61\144\40\44\155\x79\x50\x72\157\x70\145\x72\x74\171", $fixture->render()); } public function testIfTagCanBeRenderedUsingSpecificFormatter() : void { $fixture = new PropertyRead("\155\171\x50\x72\157\x70\145\x72\x74\171"); $formatter = m::mock(Formatter::class); $formatter->shouldReceive("\146\157\x72\x6d\x61\164")->with($fixture)->andReturn("\x52\x65\156\x64\145\x72\x65\144\40\x6f\165\164\x70\165\x74"); $this->assertSame("\122\145\156\144\145\x72\145\x64\40\x6f\165\x74\x70\165\164", $fixture->render($formatter)); } public function testHasVariableName() : void { $expected = "\155\x79\120\x72\x6f\160\145\162\x74\171"; $fixture = new PropertyRead($expected); $this->assertSame($expected, $fixture->getVariableName()); } public function testHasType() : void { $expected = new String_(); $fixture = new PropertyRead("\155\x79\x50\162\x6f\x70\145\x72\x74\x79", $expected); $this->assertSame($expected, $fixture->getType()); } public function testHasDescription() : void { $expected = new Description("\104\x65\163\x63\162\151\160\x74\x69\157\x6e"); $fixture = new PropertyRead("\x31\x2e\60", null, $expected); $this->assertSame($expected, $fixture->getDescription()); } public function testStringRepresentationIsReturned() : void { $fixture = new PropertyRead("\x6d\x79\120\162\x6f\160\145\162\x74\x79", new String_(), new Description("\x44\145\163\143\162\x69\x70\x74\x69\x6f\156")); $this->assertSame("\x73\164\x72\x69\156\147\x20\44\155\171\x50\x72\x6f\x70\145\162\x74\171\x20\x44\x65\163\x63\x72\x69\x70\x74\151\x6f\156", (string) $fixture); } public function testFactoryMethod() : void { $typeResolver = new TypeResolver(); $descriptionFactory = m::mock(DescriptionFactory::class); $context = new Context(''); $description = new Description("\115\x79\x20\104\145\x73\x63\x72\151\160\x74\151\x6f\x6e"); $descriptionFactory->shouldReceive("\143\162\x65\x61\x74\x65")->with("\x4d\x79\40\104\x65\x73\x63\162\151\x70\164\151\157\x6e", $context)->andReturn($description); $fixture = PropertyRead::create("\x73\164\162\x69\156\147\40\44\x6d\171\x50\162\157\x70\x65\x72\164\x79\40\x4d\x79\40\x44\x65\163\x63\162\x69\x70\164\151\157\156", $typeResolver, $descriptionFactory, $context); $this->assertSame("\163\164\x72\x69\x6e\147\x20\x24\155\x79\x50\162\157\160\x65\162\x74\x79\x20\115\x79\x20\x44\x65\163\x63\162\151\160\x74\x69\x6f\156", (string) $fixture); $this->assertSame("\x6d\x79\120\162\x6f\160\145\162\164\171", $fixture->getVariableName()); $this->assertInstanceOf(String_::class, $fixture->getType()); $this->assertSame($description, $fixture->getDescription()); } public function testFactoryMethodWithoutType() : void { $typeResolver = new TypeResolver(); $fqsenResolver = new FqsenResolver(); $tagFactory = new StandardTagFactory($fqsenResolver); $descriptionFactory = new DescriptionFactory($tagFactory); $context = new Context(''); $fixture = PropertyRead::create("\44\155\171\120\141\x72\x61\155\x65\164\145\x72\x20\115\x79\40\104\145\163\x63\162\x69\160\x74\151\157\x6e", $typeResolver, $descriptionFactory, $context); $this->assertSame("\44\155\x79\x50\141\162\x61\x6d\145\x74\145\162\40\x4d\x79\40\104\x65\163\x63\162\151\160\x74\x69\x6f\x6e", (string) $fixture); $this->assertSame("\x6d\x79\120\141\162\x61\x6d\x65\x74\145\x72", $fixture->getVariableName()); $this->assertNull($fixture->getType()); $this->assertSame("\x4d\171\x20\x44\x65\x73\143\x72\151\160\164\151\x6f\x6e", $fixture->getDescription() . ''); } public function testFactoryMethodWithType() : void { $typeResolver = new TypeResolver(); $fqsenResolver = new FqsenResolver(); $tagFactory = new StandardTagFactory($fqsenResolver); $descriptionFactory = new DescriptionFactory($tagFactory); $context = new Context(''); $fixture = PropertyRead::create("\151\156\164\40\115\171\40\104\145\x73\143\162\151\x70\164\151\x6f\156", $typeResolver, $descriptionFactory, $context); $this->assertSame("\x69\156\164\x20\x4d\x79\40\x44\x65\x73\x63\162\151\x70\164\151\157\156", (string) $fixture); $this->assertSame('', $fixture->getVariableName()); $this->assertInstanceOf(Integer::class, $fixture->getType()); $this->assertSame("\115\171\x20\104\145\x73\x63\x72\x69\x70\164\151\157\156", $fixture->getDescription() . ''); } public function testFactoryMethodFailsIfEmptyBodyIsGiven() : void { $this->expectException("\111\156\x76\x61\x6c\x69\144\101\x72\x67\x75\155\x65\x6e\x74\105\x78\143\145\x70\x74\x69\157\x6e"); $descriptionFactory = m::mock(DescriptionFactory::class); PropertyRead::create('', new TypeResolver(), $descriptionFactory); } public function testFactoryMethodFailsIfResolverIsNull() : void { $this->expectException("\111\x6e\166\141\154\x69\x64\101\x72\x67\x75\x6d\x65\x6e\x74\105\170\x63\x65\x70\x74\151\x6f\x6e"); PropertyRead::create("\x62\157\x64\x79"); } public function testFactoryMethodFailsIfDescriptionFactoryIsNull() : void { $this->expectException("\111\156\166\x61\x6c\151\144\101\x72\147\x75\x6d\x65\x6e\x74\x45\x78\143\x65\160\x74\151\157\156"); PropertyRead::create("\x62\157\144\171", new TypeResolver()); } }
Function Calls
None |
Stats
MD5 | 1ce275ea81536d304cb3e61ca6b9856a |
Eval Count | 0 |
Decode Time | 125 ms |