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 Tymon\JWTAuth\Test;${"G\x4cOB\x41L\x53"}["\x65\x62\x69\x76\x79h\x64\x79"]=..

Decoded Output download

<?php namespace Tymon\JWTAuth\Test;${"GLOBALS"}["ebivyhdy"]="request";${"GLOBALS"}["pxobxgtxamom"]="blacklist";${"GLOBALS"}["cxrtkhy"]="manager";${"GLOBALS"}["wafikgc"]="result";${"GLOBALS"}["xrjftr"]="newToken";${"GLOBALS"}["okjebet"]="user";${"GLOBALS"}["xjmyup"]="payload";${"GLOBALS"}["evncgtny"]="token";${"GLOBALS"}["obblpug"]="payloadFactory";use Illuminate\Http\Request;use Mockery;use stdClass;use Tymon\JWTAuth\Contracts\Providers\Auth;use Tymon\JWTAuth\Exceptions\JWTException;use Tymon\JWTAuth\Exceptions\TokenInvalidException;use Tymon\JWTAuth\Factory;use Tymon\JWTAuth\Http\Parser\Parser;use Tymon\JWTAuth\JWTAuth;use Tymon\JWTAuth\Manager;use Tymon\JWTAuth\Payload;use Tymon\JWTAuth\Test\Stubs\UserStub;use Tymon\JWTAuth\Token;class JWTAuthTest extends AbstractTestCase{protected$manager;protected$auth;protected$parser;protected$jwtAuth;public function setUp():void{$this->manager=Mockery::mock(Manager::class);$this->auth=Mockery::mock(Auth::class);$this->parser=Mockery::mock(Parser::class);$this->jwtAuth=new JWTAuth($this->manager,$this->auth,$this->parser);}public function it_should_return_a_token_when_passing_a_user(){${"GLOBALS"}["oujmgmojng"]="payloadFactory";$oyktmkkcvjd="token";${${"GLOBALS"}["oujmgmojng"]}=Mockery::mock(Factory::class);$payloadFactory->shouldReceive("make")->andReturn(Mockery::mock(Payload::class));$this->manager->shouldReceive("getPayloadFactory->customClaims")->once()->with(["sub"=>1,"prv"=>sha1("Tymon\JWTAuth\Test\\Stubs\\UserStub"),"foo"=>"bar","role"=>"admin"])->andReturn(${${"GLOBALS"}["obblpug"]});$this->manager->shouldReceive("encode->get")->once()->andReturn("foo.bar.baz");${${"GLOBALS"}["evncgtny"]}=$this->jwtAuth->fromUser(new UserStub);$this->assertSame(${$oyktmkkcvjd},"foo.bar.baz");}public function it_should_pass_provider_check_if_hash_matches(){${${"GLOBALS"}["obblpug"]}=Mockery::mock(Factory::class);${"GLOBALS"}["hgskxveooa"]="payloadFactory";$payloadFactory->shouldReceive("make")->andReturn(Mockery::mock(Payload::class));$payloadFactory->shouldReceive("get")->with("prv")->andReturn(sha1("Tymon\JWTAuth\Test\Stubs\\UserStub"));$this->manager->shouldReceive("decode")->once()->andReturn(${${"GLOBALS"}["hgskxveooa"]});$this->assertTrue($this->jwtAuth->setToken("foo.bar.baz")->checkSubjectModel("Tymon\\JWTAuth\Test\Stubs\UserStub"));}public function it_should_pass_provider_check_if_hash_matches_when_provider_is_null(){$gfdfdse="payloadFactory";${$gfdfdse}=Mockery::mock(Factory::class);$payloadFactory->shouldReceive("make")->andReturn(Mockery::mock(Payload::class));$payloadFactory->shouldReceive("get")->with("prv")->andReturnNull();$this->manager->shouldReceive("decode")->once()->andReturn(${${"GLOBALS"}["obblpug"]});$this->assertTrue($this->jwtAuth->setToken("foo.bar.baz")->checkSubjectModel("Tymon\\JWTAuth\Test\\Stubs\\UserStub"));}public function it_should_not_pass_provider_check_if_hash_not_match(){${${"GLOBALS"}["obblpug"]}=Mockery::mock(Factory::class);$payloadFactory->shouldReceive("make")->andReturn(Mockery::mock(Payload::class));$payloadFactory->shouldReceive("get")->with("prv")->andReturn(sha1("Tymon\JWTAuth\Test\Stubs\\UserStub1"));$this->manager->shouldReceive("decode")->once()->andReturn(${${"GLOBALS"}["obblpug"]});$this->assertFalse($this->jwtAuth->setToken("foo.bar.baz")->checkSubjectModel("Tymon\JWTAuth\Test\\Stubs\UserStub"));}public function it_should_return_a_token_when_passing_valid_credentials_to_attempt_method(){${"GLOBALS"}["yncqqbymxx"]="payloadFactory";${"GLOBALS"}["lfstrgbzlyo"]="token";${${"GLOBALS"}["yncqqbymxx"]}=Mockery::mock(Factory::class);$vlntvfr="payloadFactory";$rkfvxkrde="token";$payloadFactory->shouldReceive("make")->andReturn(Mockery::mock(Payload::class));$this->manager->shouldReceive("getPayloadFactory->customClaims")->once()->with(["sub"=>1,"prv"=>sha1("Tymon\\JWTAuth\\Test\\Stubs\UserStub"),"foo"=>"bar","role"=>"admin"])->andReturn(${$vlntvfr});$this->manager->shouldReceive("encode->get")->once()->andReturn("foo.bar.baz");$this->auth->shouldReceive("byCredentials")->once()->andReturn(true);$this->auth->shouldReceive("user")->once()->andReturn(new UserStub);${$rkfvxkrde}=$this->jwtAuth->attempt(["foo"=>"bar"]);$this->assertSame(${${"GLOBALS"}["lfstrgbzlyo"]},"foo.bar.baz");}public function it_should_return_false_when_passing_invalid_credentials_to_attempt_method(){${"GLOBALS"}["qpuxjpijah"]="token";$this->manager->shouldReceive("encode->get")->never();$this->auth->shouldReceive("byCredentials")->once()->andReturn(false);${"GLOBALS"}["ctwjbq"]="token";$this->auth->shouldReceive("user")->never();${${"GLOBALS"}["qpuxjpijah"]}=$this->jwtAuth->attempt(["foo"=>"bar"]);$this->assertFalse(${${"GLOBALS"}["ctwjbq"]});}public function it_should_throw_an_exception_when_not_providing_a_token(){$this->expectException(JWTException::class);$this->expectExceptionMessage("A token is required");$this->jwtAuth->toUser();}public function it_should_return_the_owning_user_from_a_token_containing_an_existing_user(){${"GLOBALS"}["fojnjnjcroo"]="payload";${${"GLOBALS"}["xjmyup"]}=Mockery::mock(Payload::class);$payload->shouldReceive("get")->once()->with("sub")->andReturn(1);$this->manager->shouldReceive("decode")->once()->andReturn(${${"GLOBALS"}["fojnjnjcroo"]});$this->auth->shouldReceive("byId")->once()->with(1)->andReturn(true);$this->auth->shouldReceive("user")->once()->andReturn((object)["id"=>1]);${${"GLOBALS"}["okjebet"]}=$this->jwtAuth->setToken("foo.bar.baz")->customClaims(["foo"=>"bar"])->authenticate();$this->assertSame($user->id,1);}public function it_should_return_false_when_passing_a_token_not_containing_an_existing_user(){${"GLOBALS"}["ithtnc"]="payload";${"GLOBALS"}["yaskowxednw"]="payload";${${"GLOBALS"}["yaskowxednw"]}=Mockery::mock(Payload::class);$payload->shouldReceive("get")->once()->with("sub")->andReturn(1);$this->manager->shouldReceive("decode")->once()->andReturn(${${"GLOBALS"}["ithtnc"]});$gyowcqzk="user";$this->auth->shouldReceive("byId")->once()->with(1)->andReturn(false);$this->auth->shouldReceive("user")->never();${$gyowcqzk}=$this->jwtAuth->setToken("foo.bar.baz")->authenticate();$this->assertFalse(${${"GLOBALS"}["okjebet"]});}public function it_should_refresh_a_token(){${${"GLOBALS"}["xrjftr"]}=Mockery::mock(Token::class);$cagsutnq="result";$newToken->shouldReceive("get")->once()->andReturn("baz.bar.foo");$this->manager->shouldReceive("customClaims->refresh")->once()->andReturn(${${"GLOBALS"}["xrjftr"]});${${"GLOBALS"}["wafikgc"]}=$this->jwtAuth->setToken("foo.bar.baz")->refresh();$this->assertSame(${$cagsutnq},"baz.bar.foo");}public function it_should_invalidate_a_token(){$pbynbrqcgw="token";${${"GLOBALS"}["evncgtny"]}=new Token("foo.bar.baz");$this->manager->shouldReceive("invalidate")->once()->with(${$pbynbrqcgw},false)->andReturn(true);$this->jwtAuth->setToken(${${"GLOBALS"}["evncgtny"]})->invalidate();}public function it_should_force_invalidate_a_token_forever(){$rbsltdny="token";${$rbsltdny}=new Token("foo.bar.baz");$this->manager->shouldReceive("invalidate")->once()->with(${${"GLOBALS"}["evncgtny"]},true)->andReturn(true);$this->jwtAuth->setToken(${${"GLOBALS"}["evncgtny"]})->invalidate(true);}public function it_should_retrieve_the_token_from_the_request(){$this->parser->shouldReceive("parseToken")->andReturn("foo.bar.baz");$this->assertInstanceOf(Token::class,$this->jwtAuth->parseToken()->getToken());$this->assertEquals($this->jwtAuth->getToken(),"foo.bar.baz");}public function it_should_get_the_authenticated_user(){${${"GLOBALS"}["cxrtkhy"]}=$this->jwtAuth->manager();$this->assertInstanceOf(Manager::class,${${"GLOBALS"}["cxrtkhy"]});}public function it_should_return_false_if_the_token_is_invalid(){$this->parser->shouldReceive("parseToken")->andReturn("foo.bar.baz");$this->manager->shouldReceive("decode")->once()->andThrow(new TokenInvalidException);$this->assertFalse($this->jwtAuth->parseToken()->check());}public function it_should_return_true_if_the_token_is_valid(){${"GLOBALS"}["yppznmigj"]="payload";${${"GLOBALS"}["yppznmigj"]}=Mockery::mock(Payload::class);${"GLOBALS"}["bqhwvnesd"]="payload";$this->parser->shouldReceive("parseToken")->andReturn("foo.bar.baz");$this->manager->shouldReceive("decode")->once()->andReturn(${${"GLOBALS"}["bqhwvnesd"]});$this->assertTrue($this->jwtAuth->parseToken()->check());}public function it_should_throw_an_exception_when_token_not_present_in_request(){$this->expectException(JWTException::class);$this->expectExceptionMessage("The token could not be parsed from the request");$this->parser->shouldReceive("parseToken")->andReturn(false);$this->jwtAuth->parseToken();}public function it_should_return_false_when_no_token_is_set(){$this->parser->shouldReceive("parseToken")->andReturn(false);$this->assertNull($this->jwtAuth->getToken());}public function it_should_magically_call_the_manager(){$this->manager->shouldReceive("getBlacklist")->andReturn(new stdClass);${"GLOBALS"}["bttjknw"]="blacklist";${${"GLOBALS"}["pxobxgtxamom"]}=$this->jwtAuth->manager()->getBlacklist();$this->assertInstanceOf(stdClass::class,${${"GLOBALS"}["bttjknw"]});}public function it_should_set_the_request(){$ffeojyk="request";${"GLOBALS"}["jpgpdrq"]="request";${"GLOBALS"}["eslurstypir"]="token";${${"GLOBALS"}["ebivyhdy"]}=Request::create("/foo","GET",["token"=>"some.random.token"]);$this->parser->shouldReceive("setRequest")->once()->with(${$ffeojyk});$this->parser->shouldReceive("parseToken")->andReturn("some.random.token");${${"GLOBALS"}["eslurstypir"]}=$this->jwtAuth->setRequest(${${"GLOBALS"}["jpgpdrq"]})->getToken();$this->assertEquals("some.random.token",${${"GLOBALS"}["evncgtny"]});}public function it_should_unset_the_token(){$vrlmypxbcia="token";$this->parser->shouldReceive("parseToken")->andThrow(new JWTException);${$vrlmypxbcia}=new Token("foo.bar.baz");$this->jwtAuth->setToken(${${"GLOBALS"}["evncgtny"]});$this->assertSame($this->jwtAuth->getToken(),${${"GLOBALS"}["evncgtny"]});$this->jwtAuth->unsetToken();$this->assertNull($this->jwtAuth->getToken());}public function it_should_get_the_manager_instance(){${${"GLOBALS"}["cxrtkhy"]}=$this->jwtAuth->manager();$this->assertInstanceOf(Manager::class,${${"GLOBALS"}["cxrtkhy"]});}public function it_should_get_the_parser_instance(){${"GLOBALS"}["jlnkev"]="parser";${"GLOBALS"}["llmnhwpx"]="parser";${${"GLOBALS"}["llmnhwpx"]}=$this->jwtAuth->parser();$this->assertInstanceOf(Parser::class,${${"GLOBALS"}["jlnkev"]});}public function it_should_get_a_claim_value(){${${"GLOBALS"}["xjmyup"]}=Mockery::mock(Payload::class);$payload->shouldReceive("get")->once()->with("sub")->andReturn(1);$this->manager->shouldReceive("decode")->once()->andReturn(${${"GLOBALS"}["xjmyup"]});$this->assertSame($this->jwtAuth->setToken("foo.bar.baz")->getClaim("sub"),1);}}
?>

Did this file decode correctly?

Original Code

<?php namespace Tymon\JWTAuth\Test;${"G\x4cOB\x41L\x53"}["\x65\x62\x69\x76\x79h\x64\x79"]="\x72\x65q\x75est";${"\x47\x4c\x4fB\x41\x4c\x53"}["p\x78\x6f\x62x\x67t\x78a\x6d\x6f\x6d"]="b\x6ca\x63\x6b\x6ci\x73\x74";${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x63\x78\x72\x74\x6bh\x79"]="\x6dana\x67\x65r";${"G\x4c\x4fBA\x4c\x53"}["w\x61\x66\x69k\x67\x63"]="\x72\x65\x73\x75l\x74";${"G\x4c\x4fB\x41\x4c\x53"}["\x78\x72\x6af\x74r"]="new\x54oke\x6e";${"G\x4cO\x42\x41\x4c\x53"}["\x6f\x6bj\x65\x62\x65\x74"]="u\x73e\x72";${"\x47\x4cO\x42\x41\x4c\x53"}["\x78\x6am\x79up"]="\x70a\x79\x6c\x6f\x61\x64";${"G\x4c\x4f\x42\x41L\x53"}["ev\x6e\x63\x67tn\x79"]="\x74\x6f\x6b\x65\x6e";${"\x47L\x4f\x42\x41L\x53"}["\x6f\x62\x62\x6c\x70\x75g"]="p\x61\x79\x6c\x6f\x61\x64\x46\x61\x63\x74\x6fry";use Illuminate\Http\Request;use Mockery;use stdClass;use Tymon\JWTAuth\Contracts\Providers\Auth;use Tymon\JWTAuth\Exceptions\JWTException;use Tymon\JWTAuth\Exceptions\TokenInvalidException;use Tymon\JWTAuth\Factory;use Tymon\JWTAuth\Http\Parser\Parser;use Tymon\JWTAuth\JWTAuth;use Tymon\JWTAuth\Manager;use Tymon\JWTAuth\Payload;use Tymon\JWTAuth\Test\Stubs\UserStub;use Tymon\JWTAuth\Token;class JWTAuthTest extends AbstractTestCase{protected$manager;protected$auth;protected$parser;protected$jwtAuth;public function setUp():void{$this->manager=Mockery::mock(Manager::class);$this->auth=Mockery::mock(Auth::class);$this->parser=Mockery::mock(Parser::class);$this->jwtAuth=new JWTAuth($this->manager,$this->auth,$this->parser);}public function it_should_return_a_token_when_passing_a_user(){${"\x47LOB\x41\x4cS"}["ou\x6a\x6d\x67m\x6fjn\x67"]="\x70\x61\x79l\x6f\x61\x64\x46\x61\x63t\x6f\x72\x79";$oyktmkkcvjd="\x74\x6f\x6b\x65\x6e";${${"\x47L\x4fB\x41LS"}["\x6f\x75\x6a\x6dg\x6d\x6fj\x6eg"]}=Mockery::mock(Factory::class);$payloadFactory->shouldReceive("\x6d\x61ke")->andReturn(Mockery::mock(Payload::class));$this->manager->shouldReceive("\x67\x65tPay\x6coa\x64F\x61c\x74\x6f\x72y-\x3ec\x75\x73t\x6fmCla\x69\x6d\x73")->once()->with(["su\x62"=>1,"p\x72\x76"=>sha1("\x54\x79\x6do\x6e\x5c\x4aWTAu\x74h\x5c\x54\x65\x73t\\\x53tub\x73\\\x55s\x65\x72St\x75b"),"\x66oo"=>"\x62\x61\x72","\x72o\x6c\x65"=>"\x61\x64\x6d\x69n"])->andReturn(${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["o\x62b\x6cp\x75g"]});$this->manager->shouldReceive("\x65nc\x6f\x64e->\x67\x65t")->once()->andReturn("foo.bar\x2eb\x61\x7a");${${"G\x4c\x4f\x42\x41\x4c\x53"}["evn\x63\x67\x74n\x79"]}=$this->jwtAuth->fromUser(new UserStub);$this->assertSame(${$oyktmkkcvjd},"f\x6fo.\x62\x61\x72\x2eb\x61\x7a");}public function it_should_pass_provider_check_if_hash_matches(){${${"\x47L\x4fB\x41L\x53"}["ob\x62l\x70\x75g"]}=Mockery::mock(Factory::class);${"G\x4cO\x42\x41L\x53"}["h\x67\x73\x6bxv\x65oo\x61"]="\x70a\x79l\x6f\x61\x64\x46act\x6fr\x79";$payloadFactory->shouldReceive("\x6dak\x65")->andReturn(Mockery::mock(Payload::class));$payloadFactory->shouldReceive("\x67\x65t")->with("\x70\x72v")->andReturn(sha1("\x54ymo\x6e\x5cJWTA\x75\x74h\x5c\x54\x65\x73t\x5cStu\x62s\\\x55se\x72\x53\x74\x75b"));$this->manager->shouldReceive("d\x65\x63o\x64e")->once()->andReturn(${${"GL\x4fBA\x4c\x53"}["h\x67sk\x78v\x65\x6f\x6f\x61"]});$this->assertTrue($this->jwtAuth->setToken("\x66oo.\x62\x61\x72\x2eba\x7a")->checkSubjectModel("\x54\x79\x6d\x6fn\\J\x57\x54A\x75th\x5c\x54e\x73\x74\x5cS\x74ub\x73\x5c\x55\x73er\x53\x74u\x62"));}public function it_should_pass_provider_check_if_hash_matches_when_provider_is_null(){$gfdfdse="\x70\x61\x79l\x6fa\x64F\x61\x63\x74\x6f\x72\x79";${$gfdfdse}=Mockery::mock(Factory::class);$payloadFactory->shouldReceive("\x6da\x6be")->andReturn(Mockery::mock(Payload::class));$payloadFactory->shouldReceive("g\x65\x74")->with("p\x72\x76")->andReturnNull();$this->manager->shouldReceive("d\x65co\x64\x65")->once()->andReturn(${${"GLOBA\x4c\x53"}["\x6f\x62b\x6c\x70\x75g"]});$this->assertTrue($this->jwtAuth->setToken("\x66o\x6f.ba\x72\x2eb\x61\x7a")->checkSubjectModel("T\x79\x6d\x6f\x6e\\\x4a\x57T\x41\x75\x74\x68\x5cT\x65s\x74\\St\x75bs\\\x55\x73e\x72S\x74\x75\x62"));}public function it_should_not_pass_provider_check_if_hash_not_match(){${${"\x47LO\x42\x41\x4cS"}["\x6fb\x62\x6c\x70u\x67"]}=Mockery::mock(Factory::class);$payloadFactory->shouldReceive("ma\x6b\x65")->andReturn(Mockery::mock(Payload::class));$payloadFactory->shouldReceive("\x67et")->with("prv")->andReturn(sha1("\x54\x79m\x6fn\x5cJ\x57T\x41u\x74h\x5cTe\x73t\x5c\x53t\x75\x62\x73\\Us\x65\x72\x53\x74u\x62\x31"));$this->manager->shouldReceive("\x64e\x63o\x64\x65")->once()->andReturn(${${"\x47\x4c\x4f\x42\x41L\x53"}["\x6fb\x62\x6c\x70\x75g"]});$this->assertFalse($this->jwtAuth->setToken("f\x6fo.\x62\x61r\x2e\x62az")->checkSubjectModel("\x54\x79\x6d\x6f\x6e\x5c\x4aWT\x41ut\x68\x5c\x54\x65\x73t\\S\x74u\x62\x73\x5c\x55\x73\x65r\x53\x74\x75\x62"));}public function it_should_return_a_token_when_passing_valid_credentials_to_attempt_method(){${"\x47LOBALS"}["y\x6e\x63\x71qb\x79mx\x78"]="pa\x79\x6co\x61\x64\x46\x61\x63\x74\x6fry";${"G\x4cO\x42\x41LS"}["\x6c\x66s\x74\x72gb\x7a\x6c\x79o"]="\x74\x6fke\x6e";${${"GL\x4fB\x41\x4cS"}["ync\x71\x71\x62\x79m\x78\x78"]}=Mockery::mock(Factory::class);$vlntvfr="\x70ay\x6c\x6fa\x64\x46\x61ct\x6f\x72y";$rkfvxkrde="t\x6fke\x6e";$payloadFactory->shouldReceive("\x6d\x61\x6b\x65")->andReturn(Mockery::mock(Payload::class));$this->manager->shouldReceive("get\x50a\x79l\x6f\x61d\x46\x61c\x74\x6fry->cus\x74\x6f\x6d\x43\x6c\x61i\x6d\x73")->once()->with(["\x73ub"=>1,"p\x72\x76"=>sha1("\x54y\x6d\x6f\x6e\\J\x57T\x41\x75th\\\x54es\x74\\S\x74u\x62\x73\x5c\x55\x73\x65r\x53tu\x62"),"\x66oo"=>"b\x61r","\x72\x6f\x6c\x65"=>"\x61\x64\x6d\x69n"])->andReturn(${$vlntvfr});$this->manager->shouldReceive("e\x6ec\x6f\x64e-\x3e\x67et")->once()->andReturn("f\x6fo.bar.ba\x7a");$this->auth->shouldReceive("\x62\x79\x43\x72\x65\x64\x65\x6e\x74\x69\x61\x6c\x73")->once()->andReturn(true);$this->auth->shouldReceive("\x75\x73er")->once()->andReturn(new UserStub);${$rkfvxkrde}=$this->jwtAuth->attempt(["\x66oo"=>"\x62\x61\x72"]);$this->assertSame(${${"\x47\x4c\x4fBA\x4c\x53"}["\x6c\x66\x73t\x72gbz\x6cy\x6f"]},"\x66oo\x2e\x62a\x72.baz");}public function it_should_return_false_when_passing_invalid_credentials_to_attempt_method(){${"G\x4c\x4f\x42AL\x53"}["q\x70\x75\x78j\x70\x69\x6a\x61\x68"]="to\x6b\x65n";$this->manager->shouldReceive("\x65\x6eco\x64e->\x67e\x74")->never();$this->auth->shouldReceive("\x62y\x43\x72\x65\x64\x65nt\x69\x61ls")->once()->andReturn(false);${"\x47\x4c\x4f\x42\x41L\x53"}["ct\x77jbq"]="\x74\x6f\x6ben";$this->auth->shouldReceive("us\x65r")->never();${${"G\x4c\x4f\x42\x41L\x53"}["\x71\x70\x75xj\x70\x69\x6aa\x68"]}=$this->jwtAuth->attempt(["foo"=>"b\x61\x72"]);$this->assertFalse(${${"\x47\x4c\x4fB\x41\x4c\x53"}["\x63\x74\x77\x6a\x62\x71"]});}public function it_should_throw_an_exception_when_not_providing_a_token(){$this->expectException(JWTException::class);$this->expectExceptionMessage("\x41 token is\x20\x72\x65\x71\x75\x69\x72\x65\x64");$this->jwtAuth->toUser();}public function it_should_return_the_owning_user_from_a_token_containing_an_existing_user(){${"G\x4cO\x42\x41LS"}["f\x6fj\x6e\x6a\x6ej\x63\x72o\x6f"]="\x70\x61\x79l\x6f\x61d";${${"\x47L\x4f\x42\x41L\x53"}["\x78\x6a\x6d\x79u\x70"]}=Mockery::mock(Payload::class);$payload->shouldReceive("get")->once()->with("\x73\x75b")->andReturn(1);$this->manager->shouldReceive("\x64\x65code")->once()->andReturn(${${"\x47L\x4fBAL\x53"}["\x66\x6f\x6a\x6ejnj\x63r\x6f\x6f"]});$this->auth->shouldReceive("byI\x64")->once()->with(1)->andReturn(true);$this->auth->shouldReceive("\x75s\x65r")->once()->andReturn((object)["\x69d"=>1]);${${"\x47L\x4fB\x41L\x53"}["o\x6b\x6ae\x62\x65\x74"]}=$this->jwtAuth->setToken("f\x6fo.\x62a\x72.\x62a\x7a")->customClaims(["\x66\x6f\x6f"=>"b\x61r"])->authenticate();$this->assertSame($user->id,1);}public function it_should_return_false_when_passing_a_token_not_containing_an_existing_user(){${"G\x4c\x4f\x42A\x4cS"}["\x69\x74\x68\x74\x6e\x63"]="pay\x6coa\x64";${"GL\x4f\x42\x41L\x53"}["\x79\x61\x73k\x6f\x77x\x65\x64n\x77"]="pay\x6co\x61\x64";${${"G\x4cOB\x41\x4c\x53"}["y\x61\x73k\x6f\x77\x78\x65dnw"]}=Mockery::mock(Payload::class);$payload->shouldReceive("ge\x74")->once()->with("\x73\x75\x62")->andReturn(1);$this->manager->shouldReceive("de\x63ode")->once()->andReturn(${${"\x47\x4cO\x42\x41L\x53"}["\x69\x74\x68\x74\x6e\x63"]});$gyowcqzk="\x75s\x65\x72";$this->auth->shouldReceive("byI\x64")->once()->with(1)->andReturn(false);$this->auth->shouldReceive("\x75ser")->never();${$gyowcqzk}=$this->jwtAuth->setToken("\x66o\x6f\x2e\x62ar\x2eba\x7a")->authenticate();$this->assertFalse(${${"GLO\x42\x41L\x53"}["o\x6b\x6a\x65\x62\x65\x74"]});}public function it_should_refresh_a_token(){${${"\x47LO\x42\x41\x4c\x53"}["\x78\x72jftr"]}=Mockery::mock(Token::class);$cagsutnq="\x72\x65\x73\x75\x6ct";$newToken->shouldReceive("\x67et")->once()->andReturn("\x62az.\x62\x61\x72\x2efo\x6f");$this->manager->shouldReceive("\x63usto\x6dC\x6caims->\x72\x65fres\x68")->once()->andReturn(${${"G\x4cO\x42\x41LS"}["\x78r\x6a\x66\x74r"]});${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x77\x61f\x69\x6b\x67c"]}=$this->jwtAuth->setToken("\x66\x6f\x6f\x2e\x62ar\x2eba\x7a")->refresh();$this->assertSame(${$cagsutnq},"\x62az.\x62a\x72\x2e\x66\x6f\x6f");}public function it_should_invalidate_a_token(){$pbynbrqcgw="\x74\x6f\x6b\x65\x6e";${${"GLO\x42\x41LS"}["\x65\x76nc\x67tny"]}=new Token("f\x6f\x6f.\x62a\x72.\x62a\x7a");$this->manager->shouldReceive("\x69\x6ev\x61lida\x74\x65")->once()->with(${$pbynbrqcgw},false)->andReturn(true);$this->jwtAuth->setToken(${${"\x47\x4cO\x42A\x4c\x53"}["e\x76nc\x67\x74\x6e\x79"]})->invalidate();}public function it_should_force_invalidate_a_token_forever(){$rbsltdny="\x74\x6f\x6b\x65\x6e";${$rbsltdny}=new Token("fo\x6f.b\x61r\x2eb\x61\x7a");$this->manager->shouldReceive("i\x6eval\x69d\x61t\x65")->once()->with(${${"G\x4cO\x42AL\x53"}["\x65\x76nc\x67t\x6e\x79"]},true)->andReturn(true);$this->jwtAuth->setToken(${${"G\x4c\x4fB\x41\x4c\x53"}["\x65\x76n\x63g\x74\x6ey"]})->invalidate(true);}public function it_should_retrieve_the_token_from_the_request(){$this->parser->shouldReceive("pa\x72\x73eTo\x6be\x6e")->andReturn("fo\x6f.\x62\x61r\x2e\x62a\x7a");$this->assertInstanceOf(Token::class,$this->jwtAuth->parseToken()->getToken());$this->assertEquals($this->jwtAuth->getToken(),"f\x6f\x6f.ba\x72.b\x61\x7a");}public function it_should_get_the_authenticated_user(){${${"\x47\x4c\x4f\x42AL\x53"}["c\x78\x72\x74\x6b\x68\x79"]}=$this->jwtAuth->manager();$this->assertInstanceOf(Manager::class,${${"G\x4c\x4fBAL\x53"}["c\x78\x72\x74k\x68\x79"]});}public function it_should_return_false_if_the_token_is_invalid(){$this->parser->shouldReceive("pa\x72seTo\x6be\x6e")->andReturn("foo.bar.\x62a\x7a");$this->manager->shouldReceive("\x64\x65c\x6f\x64e")->once()->andThrow(new TokenInvalidException);$this->assertFalse($this->jwtAuth->parseToken()->check());}public function it_should_return_true_if_the_token_is_valid(){${"G\x4cO\x42\x41\x4c\x53"}["\x79p\x70z\x6e\x6d\x69\x67\x6a"]="\x70a\x79lo\x61\x64";${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x79\x70p\x7an\x6di\x67j"]}=Mockery::mock(Payload::class);${"\x47\x4cOB\x41\x4c\x53"}["b\x71\x68\x77v\x6ee\x73\x64"]="\x70a\x79lo\x61\x64";$this->parser->shouldReceive("\x70\x61\x72s\x65T\x6f\x6ben")->andReturn("\x66\x6fo\x2ebar\x2ebaz");$this->manager->shouldReceive("\x64e\x63\x6f\x64\x65")->once()->andReturn(${${"G\x4cO\x42ALS"}["\x62\x71hw\x76\x6e\x65s\x64"]});$this->assertTrue($this->jwtAuth->parseToken()->check());}public function it_should_throw_an_exception_when_token_not_present_in_request(){$this->expectException(JWTException::class);$this->expectExceptionMessage("Th\x65\x20t\x6f\x6b\x65\x6e\x20\x63\x6fu\x6c\x64\x20\x6eo\x74 \x62\x65 \x70\x61\x72\x73\x65d\x20fro\x6d t\x68\x65\x20\x72equ\x65st");$this->parser->shouldReceive("p\x61\x72seTok\x65\x6e")->andReturn(false);$this->jwtAuth->parseToken();}public function it_should_return_false_when_no_token_is_set(){$this->parser->shouldReceive("p\x61\x72\x73e\x54\x6fk\x65n")->andReturn(false);$this->assertNull($this->jwtAuth->getToken());}public function it_should_magically_call_the_manager(){$this->manager->shouldReceive("\x67e\x74Bl\x61\x63\x6blist")->andReturn(new stdClass);${"G\x4c\x4fB\x41\x4c\x53"}["\x62\x74tj\x6bnw"]="\x62\x6c\x61\x63k\x6ci\x73\x74";${${"\x47\x4c\x4fBA\x4c\x53"}["p\x78\x6fbxgt\x78am\x6f\x6d"]}=$this->jwtAuth->manager()->getBlacklist();$this->assertInstanceOf(stdClass::class,${${"\x47L\x4fB\x41\x4c\x53"}["\x62t\x74\x6a\x6b\x6ew"]});}public function it_should_set_the_request(){$ffeojyk="\x72\x65\x71\x75\x65\x73t";${"\x47\x4cO\x42AL\x53"}["\x6a\x70\x67\x70\x64\x72\x71"]="\x72eq\x75\x65\x73\x74";${"\x47L\x4fB\x41LS"}["\x65\x73lu\x72s\x74y\x70\x69r"]="\x74o\x6b\x65n";${${"G\x4c\x4fB\x41\x4c\x53"}["\x65\x62\x69v\x79\x68d\x79"]}=Request::create("/fo\x6f","G\x45\x54",["to\x6b\x65n"=>"so\x6de\x2e\x72\x61\x6ed\x6fm.\x74\x6fken"]);$this->parser->shouldReceive("se\x74\x52\x65q\x75e\x73\x74")->once()->with(${$ffeojyk});$this->parser->shouldReceive("\x70\x61rseT\x6fk\x65\x6e")->andReturn("som\x65.r\x61n\x64om.tok\x65\x6e");${${"\x47LO\x42\x41\x4cS"}["\x65\x73\x6c\x75\x72\x73t\x79p\x69r"]}=$this->jwtAuth->setRequest(${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["j\x70gp\x64r\x71"]})->getToken();$this->assertEquals("\x73o\x6de\x2e\x72\x61nd\x6f\x6d.t\x6fk\x65n",${${"GLO\x42A\x4c\x53"}["\x65\x76\x6ec\x67\x74\x6ey"]});}public function it_should_unset_the_token(){$vrlmypxbcia="\x74o\x6b\x65n";$this->parser->shouldReceive("\x70a\x72seT\x6f\x6be\x6e")->andThrow(new JWTException);${$vrlmypxbcia}=new Token("\x66o\x6f\x2e\x62a\x72.\x62\x61z");$this->jwtAuth->setToken(${${"\x47\x4cO\x42ALS"}["\x65\x76n\x63\x67tny"]});$this->assertSame($this->jwtAuth->getToken(),${${"\x47\x4cO\x42A\x4c\x53"}["e\x76\x6e\x63\x67\x74\x6e\x79"]});$this->jwtAuth->unsetToken();$this->assertNull($this->jwtAuth->getToken());}public function it_should_get_the_manager_instance(){${${"\x47\x4c\x4f\x42A\x4c\x53"}["\x63\x78r\x74\x6b\x68\x79"]}=$this->jwtAuth->manager();$this->assertInstanceOf(Manager::class,${${"\x47\x4cO\x42\x41\x4c\x53"}["\x63\x78\x72\x74\x6b\x68\x79"]});}public function it_should_get_the_parser_instance(){${"\x47\x4c\x4fB\x41\x4c\x53"}["\x6a\x6c\x6e\x6b\x65\x76"]="pa\x72\x73\x65\x72";${"GL\x4f\x42\x41\x4c\x53"}["llm\x6eh\x77p\x78"]="\x70a\x72s\x65\x72";${${"\x47L\x4f\x42\x41L\x53"}["l\x6c\x6dnh\x77\x70x"]}=$this->jwtAuth->parser();$this->assertInstanceOf(Parser::class,${${"\x47\x4cO\x42\x41\x4cS"}["\x6a\x6c\x6eke\x76"]});}public function it_should_get_a_claim_value(){${${"\x47\x4c\x4f\x42AL\x53"}["x\x6a\x6d\x79\x75\x70"]}=Mockery::mock(Payload::class);$payload->shouldReceive("ge\x74")->once()->with("su\x62")->andReturn(1);$this->manager->shouldReceive("dec\x6fde")->once()->andReturn(${${"\x47\x4c\x4f\x42\x41L\x53"}["\x78j\x6d\x79\x75\x70"]});$this->assertSame($this->jwtAuth->setToken("\x66o\x6f.ba\x72.\x62a\x7a")->getClaim("s\x75\x62"),1);}}
?>

Function Calls

None

Variables

None

Stats

MD5 a2b8698f5621179be03577d7635f0fdf
Eval Count 0
Decode Time 122 ms