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\Types\Context; use PHPUnit\Framework\TestCase; class LinkTest extends TestCase { public function tearDown() : void { m::close(); } public function testIfCorrectTagNameIsReturned() : void { $fixture = new Link("http://this.is.my/link", new Description("Description")); $this->assertSame("link", $fixture->getName()); } public function testIfTagCanBeRenderedUsingDefaultFormatter() : void { $fixture = new Link("http://this.is.my/link", new Description("Description")); $this->assertSame("@link http://this.is.my/link Description", $fixture->render()); } public function testIfTagCanBeRenderedUsingSpecificFormatter() : void { $fixture = new Link("http://this.is.my/link", new Description("Description")); $formatter = m::mock(Formatter::class); $formatter->shouldReceive("format")->with($fixture)->andReturn("Rendered output"); $this->assertSame("Rendered output", $fixture->render($formatter)); } public function testHasLinkUrl() : void { $expected = "http://this.is.my/link"; $fixture = new Link($expected); $this->assertSame($expected, $fixture->getLink()); } public function testHasDescription() : void { $expected = new Description("Description"); $fixture = new Link("http://this.is.my/link", $expected); $this->assertSame($expected, $fixture->getDescription()); } public function testStringRepresentationIsReturned() : void { $fixture = new Link("http://this.is.my/link", new Description("Description")); $this->assertSame("http://this.is.my/link Description", (string) $fixture); } public function testStringRepresentationIsReturnedWithoutDescription() : void { $fixture = new Link("http://this.is.my/link"); $this->assertSame("http://this.is.my/link", (string) $fixture); $fixture = new Link("http://this.is.my/link", new Description('')); $this->assertSame("http://this.is.my/link", (string) $fixture); } public function testFactoryMethod() : void { $descriptionFactory = m::mock(DescriptionFactory::class); $context = new Context(''); $links = "http://this.is.my/link"; $description = new Description("My Description"); $descriptionFactory->shouldReceive("create")->with("My Description", $context)->andReturn($description); $fixture = Link::create("http://this.is.my/link My Description", $descriptionFactory, $context); $this->assertSame("http://this.is.my/link My Description", (string) $fixture); $this->assertSame($links, $fixture->getLink()); $this->assertSame($description, $fixture->getDescription()); } public function testFactoryMethodWithoutSpaceBeforeUrl() : void { $fqsenResolver = new FqsenResolver(); $tagFactory = new StandardTagFactory($fqsenResolver); $descriptionFactory = new DescriptionFactory($tagFactory); $context = new Context(''); $fixture = Link::create("http://this.is.my/link My Description ", $descriptionFactory, $context); $this->assertSame("http://this.is.my/link My Description ", (string) $fixture); $this->assertSame("My Description ", $fixture->getDescription() . ''); } public function testFactoryMethodWithSpaceBeforeUrl() : void { $fqsenResolver = new FqsenResolver(); $tagFactory = new StandardTagFactory($fqsenResolver); $descriptionFactory = new DescriptionFactory($tagFactory); $context = new Context(''); $fixture = Link::create(" http://this.is.my/link My Description ", $descriptionFactory, $context); $this->assertSame("http://this.is.my/link My Description ", (string) $fixture); $this->assertSame("http://this.is.my/link My Description ", $fixture->getDescription() . ''); } public function testFactoryMethodCreatesEmptyLinkTag() : void { $descriptionFactory = m::mock(DescriptionFactory::class); $descriptionFactory->shouldReceive("create")->never(); $fixture = Link::create('', $descriptionFactory, new Context('')); $this->assertSame('', (string) $fixture); $this->assertSame('', $fixture->getLink()); $this->assertSame(null, $fixture->getDescription()); } } ?>

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\Types\Context; use PHPUnit\Framework\TestCase; class LinkTest extends TestCase { public function tearDown() : void { m::close(); } public function testIfCorrectTagNameIsReturned() : void { $fixture = new Link("\x68\164\x74\x70\72\57\x2f\x74\150\x69\163\56\151\x73\56\155\x79\57\x6c\151\x6e\x6b", new Description("\104\x65\x73\143\x72\151\x70\x74\x69\x6f\156")); $this->assertSame("\x6c\x69\x6e\153", $fixture->getName()); } public function testIfTagCanBeRenderedUsingDefaultFormatter() : void { $fixture = new Link("\x68\164\164\160\x3a\57\57\164\150\151\163\x2e\151\163\56\x6d\x79\57\154\151\156\153", new Description("\104\145\x73\x63\x72\151\x70\164\151\157\156")); $this->assertSame("\x40\x6c\x69\156\x6b\40\150\164\x74\160\x3a\57\57\164\x68\x69\163\x2e\x69\x73\56\155\x79\x2f\x6c\x69\x6e\153\40\104\x65\163\x63\162\x69\160\x74\x69\x6f\x6e", $fixture->render()); } public function testIfTagCanBeRenderedUsingSpecificFormatter() : void { $fixture = new Link("\x68\164\x74\160\72\57\57\164\150\151\x73\x2e\x69\x73\56\155\171\57\154\151\x6e\153", new Description("\104\x65\163\x63\162\x69\x70\x74\151\x6f\156")); $formatter = m::mock(Formatter::class); $formatter->shouldReceive("\146\x6f\162\155\141\164")->with($fixture)->andReturn("\122\145\156\x64\145\162\145\x64\40\157\165\x74\160\x75\x74"); $this->assertSame("\122\145\x6e\144\x65\x72\145\x64\x20\x6f\x75\x74\x70\x75\164", $fixture->render($formatter)); } public function testHasLinkUrl() : void { $expected = "\150\164\x74\x70\x3a\x2f\57\164\x68\151\x73\56\x69\x73\56\x6d\x79\x2f\x6c\x69\156\x6b"; $fixture = new Link($expected); $this->assertSame($expected, $fixture->getLink()); } public function testHasDescription() : void { $expected = new Description("\104\x65\x73\143\x72\x69\x70\164\x69\x6f\x6e"); $fixture = new Link("\150\164\x74\x70\72\x2f\57\x74\150\151\163\x2e\x69\x73\x2e\155\171\57\154\x69\x6e\153", $expected); $this->assertSame($expected, $fixture->getDescription()); } public function testStringRepresentationIsReturned() : void { $fixture = new Link("\x68\164\x74\160\x3a\x2f\57\x74\x68\151\163\56\x69\163\56\x6d\171\57\x6c\151\156\x6b", new Description("\104\145\163\x63\x72\x69\160\x74\151\x6f\156")); $this->assertSame("\150\x74\164\160\x3a\x2f\57\164\150\x69\x73\x2e\151\163\x2e\x6d\171\x2f\154\x69\156\153\40\x44\145\x73\143\162\x69\160\x74\151\x6f\x6e", (string) $fixture); } public function testStringRepresentationIsReturnedWithoutDescription() : void { $fixture = new Link("\150\x74\x74\160\72\57\x2f\164\150\x69\163\56\151\x73\x2e\x6d\171\x2f\x6c\151\x6e\153"); $this->assertSame("\150\x74\164\x70\x3a\57\x2f\164\x68\151\163\56\151\163\x2e\155\171\57\x6c\x69\156\x6b", (string) $fixture); $fixture = new Link("\x68\164\x74\160\72\x2f\57\164\x68\151\x73\56\151\163\56\x6d\171\x2f\x6c\151\156\x6b", new Description('')); $this->assertSame("\150\164\x74\160\72\57\57\x74\x68\151\163\56\151\x73\x2e\155\x79\x2f\154\151\x6e\x6b", (string) $fixture); } public function testFactoryMethod() : void { $descriptionFactory = m::mock(DescriptionFactory::class); $context = new Context(''); $links = "\150\x74\x74\x70\x3a\57\x2f\164\150\151\x73\56\151\x73\56\x6d\171\57\154\151\x6e\153"; $description = new Description("\115\x79\40\x44\x65\x73\x63\162\x69\160\164\x69\x6f\x6e"); $descriptionFactory->shouldReceive("\x63\162\x65\x61\164\x65")->with("\x4d\x79\40\104\145\x73\x63\162\x69\160\x74\151\x6f\x6e", $context)->andReturn($description); $fixture = Link::create("\x68\x74\164\x70\72\x2f\57\x74\150\151\163\x2e\151\x73\x2e\155\x79\x2f\x6c\x69\x6e\153\40\115\x79\x20\x44\145\x73\143\x72\x69\160\x74\x69\x6f\x6e", $descriptionFactory, $context); $this->assertSame("\150\x74\x74\160\72\x2f\x2f\164\x68\151\163\56\x69\163\x2e\155\171\x2f\x6c\x69\156\153\40\x4d\171\40\x44\x65\x73\x63\x72\151\x70\x74\x69\157\x6e", (string) $fixture); $this->assertSame($links, $fixture->getLink()); $this->assertSame($description, $fixture->getDescription()); } public function testFactoryMethodWithoutSpaceBeforeUrl() : void { $fqsenResolver = new FqsenResolver(); $tagFactory = new StandardTagFactory($fqsenResolver); $descriptionFactory = new DescriptionFactory($tagFactory); $context = new Context(''); $fixture = Link::create("\150\164\164\160\72\57\57\164\x68\x69\163\56\x69\163\x2e\x6d\171\57\154\151\156\153\x20\115\171\40\104\145\163\143\x72\151\x70\164\x69\x6f\156\40", $descriptionFactory, $context); $this->assertSame("\x68\x74\x74\160\72\x2f\x2f\164\x68\151\163\56\x69\x73\x2e\x6d\x79\x2f\154\x69\156\x6b\40\x4d\171\x20\x44\145\163\x63\x72\151\160\164\x69\157\156\x20", (string) $fixture); $this->assertSame("\x4d\171\40\x44\145\x73\x63\x72\x69\160\x74\151\157\156\x20", $fixture->getDescription() . ''); } public function testFactoryMethodWithSpaceBeforeUrl() : void { $fqsenResolver = new FqsenResolver(); $tagFactory = new StandardTagFactory($fqsenResolver); $descriptionFactory = new DescriptionFactory($tagFactory); $context = new Context(''); $fixture = Link::create("\40\150\x74\x74\160\72\x2f\57\164\150\x69\x73\x2e\x69\x73\x2e\155\x79\57\154\x69\156\x6b\x20\115\x79\40\x44\x65\x73\143\x72\151\160\164\151\157\x6e\40", $descriptionFactory, $context); $this->assertSame("\150\164\x74\x70\x3a\x2f\x2f\164\150\151\163\56\x69\163\x2e\x6d\171\x2f\x6c\151\156\153\40\x4d\x79\40\104\x65\x73\x63\x72\x69\160\164\151\x6f\x6e\40", (string) $fixture); $this->assertSame("\x68\x74\164\x70\x3a\x2f\57\164\150\151\x73\x2e\151\163\56\x6d\x79\57\154\151\x6e\x6b\x20\115\x79\x20\x44\145\163\x63\162\151\160\164\151\x6f\156\40", $fixture->getDescription() . ''); } public function testFactoryMethodCreatesEmptyLinkTag() : void { $descriptionFactory = m::mock(DescriptionFactory::class); $descriptionFactory->shouldReceive("\x63\x72\145\x61\x74\145")->never(); $fixture = Link::create('', $descriptionFactory, new Context('')); $this->assertSame('', (string) $fixture); $this->assertSame('', $fixture->getLink()); $this->assertSame(null, $fixture->getDescription()); } }

Function Calls

None

Variables

None

Stats

MD5 36ef738a905da9fa448ca63626e8a77e
Eval Count 0
Decode Time 104 ms