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 goto r4ncn; DC_UD: interface Swift_Transport_EsmtpHandlerMixin extends Swift_Transp..
Decoded Output download
<?php
goto r4ncn; DC_UD: interface Swift_Transport_EsmtpHandlerMixin extends Swift_Transport_EsmtpHandler { public function setUsername($user); public function setPassword($pass); } goto prHA_; r4ncn: require_once \dirname(__DIR__) . "/EsmtpTransportTest.php"; goto DC_UD; prHA_: class Swift_Transport_EsmtpTransport_ExtensionSupportTest extends Swift_Transport_EsmtpTransportTest { public function testExtensionHandlersAreSortedAsNeeded() { $buf = $this->getBuffer(); $smtp = $this->getTransport($buf); $ext1 = $this->getMockery("Swift_Transport_EsmtpHandler")->shouldIgnoreMissing(); $ext2 = $this->getMockery("Swift_Transport_EsmtpHandler")->shouldIgnoreMissing(); $ext1->shouldReceive("getHandledKeyword")->zeroOrMoreTimes()->andReturn("AUTH"); $ext1->shouldReceive("getPriorityOver")->zeroOrMoreTimes()->with("STARTTLS")->andReturn(1); $ext2->shouldReceive("getHandledKeyword")->zeroOrMoreTimes()->andReturn("STARTTLS"); $ext2->shouldReceive("getPriorityOver")->zeroOrMoreTimes()->with("AUTH")->andReturn(-1); $this->finishBuffer($buf); $smtp->setExtensionHandlers(array($ext1, $ext2)); $this->assertEquals(array($ext2, $ext1), $smtp->getExtensionHandlers()); } public function testHandlersAreNotifiedOfParams() { $buf = $this->getBuffer(); $smtp = $this->getTransport($buf); $ext1 = $this->getMockery("Swift_Transport_EsmtpHandler")->shouldIgnoreMissing(); $ext2 = $this->getMockery("Swift_Transport_EsmtpHandler")->shouldIgnoreMissing(); $buf->shouldReceive("readLine")->once()->with(0)->andReturn("220 server.com foo
\xa"); $buf->shouldReceive("write")->once()->with(Mockery::pattern("~^EHLO .*?\r\n$~D"))->andReturn(1); $buf->shouldReceive("readLine")->once()->with(1)->andReturn("250-ServerName.tld
"); $buf->shouldReceive("readLine")->once()->with(1)->andReturn("250-AUTH PLAIN LOGIN\xd\xa"); $buf->shouldReceive("readLine")->once()->with(1)->andReturn("250 SIZE=123456
"); $ext1->shouldReceive("getHandledKeyword")->zeroOrMoreTimes()->andReturn("AUTH"); $ext1->shouldReceive("setKeywordParams")->once()->with(array("PLAIN", "LOGIN")); $ext2->shouldReceive("getHandledKeyword")->zeroOrMoreTimes()->andReturn("SIZE"); $ext2->shouldReceive("setKeywordParams")->zeroOrMoreTimes()->with(array("123456")); $this->finishBuffer($buf); $smtp->setExtensionHandlers(array($ext1, $ext2)); $smtp->start(); } public function testSupportedExtensionHandlersAreRunAfterEhlo() { $buf = $this->getBuffer(); $smtp = $this->getTransport($buf); $ext1 = $this->getMockery("Swift_Transport_EsmtpHandler")->shouldIgnoreMissing(); $ext2 = $this->getMockery("Swift_Transport_EsmtpHandler")->shouldIgnoreMissing(); $ext3 = $this->getMockery("Swift_Transport_EsmtpHandler")->shouldIgnoreMissing(); $buf->shouldReceive("readLine")->once()->with(0)->andReturn("220 server.com foo
\xa"); $buf->shouldReceive("write")->once()->with(Mockery::pattern("~^EHLO .*?\r\n$~D"))->andReturn(1); $buf->shouldReceive("readLine")->once()->with(1)->andReturn("250-ServerName.tld\xd
"); $buf->shouldReceive("readLine")->once()->with(1)->andReturn("250-AUTH PLAIN LOGIN\xd\xa"); $buf->shouldReceive("readLine")->once()->with(1)->andReturn("250 SIZE=123456\xd\xa"); $ext1->shouldReceive("getHandledKeyword")->zeroOrMoreTimes()->andReturn("AUTH"); $ext1->shouldReceive("afterEhlo")->once()->with($smtp); $ext2->shouldReceive("getHandledKeyword")->zeroOrMoreTimes()->andReturn("SIZE"); $ext2->shouldReceive("afterEhlo")->zeroOrMoreTimes()->with($smtp); $ext3->shouldReceive("getHandledKeyword")->zeroOrMoreTimes()->andReturn("STARTTLS"); $ext3->shouldReceive("afterEhlo")->never()->with($smtp); $this->finishBuffer($buf); $smtp->setExtensionHandlers(array($ext1, $ext2, $ext3)); $smtp->start(); } public function testExtensionsCanModifyMailFromParams() { $buf = $this->getBuffer(); $dispatcher = $this->createEventDispatcher(); $smtp = new Swift_Transport_EsmtpTransport($buf, array(), $dispatcher, "example.org"); $ext1 = $this->getMockery("Swift_Transport_EsmtpHandler")->shouldIgnoreMissing(); $ext2 = $this->getMockery("Swift_Transport_EsmtpHandler")->shouldIgnoreMissing(); $ext3 = $this->getMockery("Swift_Transport_EsmtpHandler")->shouldIgnoreMissing(); $message = $this->createMessage(); $message->shouldReceive("getFrom")->zeroOrMoreTimes()->andReturn(array("me@domain" => "Me")); $message->shouldReceive("getTo")->zeroOrMoreTimes()->andReturn(array("foo@bar" => null)); $buf->shouldReceive("readLine")->once()->with(0)->andReturn("220 server.com foo\xd\xa"); $buf->shouldReceive("write")->once()->with(Mockery::pattern("~^EHLO .*?\r\n$~D"))->andReturn(1); $buf->shouldReceive("readLine")->once()->with(1)->andReturn("250-ServerName.tld
"); $buf->shouldReceive("readLine")->once()->with(1)->andReturn("250-AUTH PLAIN LOGIN
"); $buf->shouldReceive("readLine")->once()->with(1)->andReturn("250 SIZE=123456\xd\xa"); $buf->shouldReceive("write")->once()->with("MAIL FROM:<me@domain> FOO ZIP
")->andReturn(2); $buf->shouldReceive("readLine")->once()->with(2)->andReturn("250 OK\xd\xa"); $buf->shouldReceive("write")->once()->with("RCPT TO:<foo@bar>
\xa")->andReturn(3); $buf->shouldReceive("readLine")->once()->with(3)->andReturn("250 OK\xd
"); $this->finishBuffer($buf); $ext1->shouldReceive("getHandledKeyword")->zeroOrMoreTimes()->andReturn("AUTH"); $ext1->shouldReceive("getMailParams")->once()->andReturn("FOO"); $ext1->shouldReceive("getPriorityOver")->zeroOrMoreTimes()->with("STARTTLS")->andReturn(1); $ext1->shouldReceive("getPriorityOver")->zeroOrMoreTimes()->with("SIZE")->andReturn(-1); $ext2->shouldReceive("getHandledKeyword")->zeroOrMoreTimes()->andReturn("SIZE"); $ext2->shouldReceive("getMailParams")->once()->andReturn("ZIP"); $ext2->shouldReceive("getPriorityOver")->zeroOrMoreTimes()->with("AUTH")->andReturn(1); $ext2->shouldReceive("getPriorityOver")->zeroOrMoreTimes()->with("STARTTLS")->andReturn(1); $ext3->shouldReceive("getHandledKeyword")->zeroOrMoreTimes()->andReturn("STARTTLS"); $ext3->shouldReceive("getMailParams")->never(); $ext3->shouldReceive("getPriorityOver")->zeroOrMoreTimes()->with("AUTH")->andReturn(-1); $ext3->shouldReceive("getPriorityOver")->zeroOrMoreTimes()->with("SIZE")->andReturn(-1); $smtp->setExtensionHandlers(array($ext1, $ext2, $ext3)); $smtp->start(); $smtp->send($message); } public function testExtensionsCanModifyRcptParams() { $buf = $this->getBuffer(); $dispatcher = $this->createEventDispatcher(); $smtp = new Swift_Transport_EsmtpTransport($buf, array(), $dispatcher, "example.org"); $ext1 = $this->getMockery("Swift_Transport_EsmtpHandler")->shouldIgnoreMissing(); $ext2 = $this->getMockery("Swift_Transport_EsmtpHandler")->shouldIgnoreMissing(); $ext3 = $this->getMockery("Swift_Transport_EsmtpHandler")->shouldIgnoreMissing(); $message = $this->createMessage(); $message->shouldReceive("getFrom")->zeroOrMoreTimes()->andReturn(array("me@domain" => "Me")); $message->shouldReceive("getTo")->zeroOrMoreTimes()->andReturn(array("foo@bar" => null)); $buf->shouldReceive("readLine")->once()->with(0)->andReturn("220 server.com foo\xd
"); $buf->shouldReceive("write")->once()->with(Mockery::pattern("~^EHLO .+?\r\n$~D"))->andReturn(1); $buf->shouldReceive("readLine")->once()->with(1)->andReturn("250-ServerName.tld
\xa"); $buf->shouldReceive("readLine")->once()->with(1)->andReturn("250-AUTH PLAIN LOGIN\xd
"); $buf->shouldReceive("readLine")->once()->with(1)->andReturn("250 SIZE=123456
\xa"); $buf->shouldReceive("write")->once()->with("MAIL FROM:<me@domain>\xd
")->andReturn(2); $buf->shouldReceive("readLine")->once()->with(2)->andReturn("250 OK\xd
"); $buf->shouldReceive("write")->once()->with("RCPT TO:<foo@bar> FOO ZIP
")->andReturn(3); $buf->shouldReceive("readLine")->once()->with(3)->andReturn("250 OK\xd
"); $this->finishBuffer($buf); $ext1->shouldReceive("getHandledKeyword")->zeroOrMoreTimes()->andReturn("AUTH"); $ext1->shouldReceive("getRcptParams")->once()->andReturn("FOO"); $ext1->shouldReceive("getPriorityOver")->zeroOrMoreTimes()->with("STARTTLS")->andReturn(1); $ext1->shouldReceive("getPriorityOver")->zeroOrMoreTimes()->with("SIZE")->andReturn(-1); $ext2->shouldReceive("getHandledKeyword")->zeroOrMoreTimes()->andReturn("SIZE"); $ext2->shouldReceive("getRcptParams")->once()->andReturn("ZIP"); $ext2->shouldReceive("getPriorityOver")->zeroOrMoreTimes()->with("STARTTLS")->andReturn(1); $ext2->shouldReceive("getPriorityOver")->zeroOrMoreTimes()->with("AUTH")->andReturn(1); $ext3->shouldReceive("getHandledKeyword")->zeroOrMoreTimes()->andReturn("STARTTLS"); $ext3->shouldReceive("getRcptParams")->never(); $ext3->shouldReceive("getPriorityOver")->zeroOrMoreTimes()->with("AUTH")->andReturn(-1); $ext3->shouldReceive("getPriorityOver")->zeroOrMoreTimes()->with("SIZE")->andReturn(-1); $smtp->setExtensionHandlers(array($ext1, $ext2, $ext3)); $smtp->start(); $smtp->send($message); } public function testExtensionsAreNotifiedOnCommand() { $buf = $this->getBuffer(); $smtp = $this->getTransport($buf); $ext1 = $this->getMockery("Swift_Transport_EsmtpHandler")->shouldIgnoreMissing(); $ext2 = $this->getMockery("Swift_Transport_EsmtpHandler")->shouldIgnoreMissing(); $ext3 = $this->getMockery("Swift_Transport_EsmtpHandler")->shouldIgnoreMissing(); $buf->shouldReceive("readLine")->once()->with(0)->andReturn("220 server.com foo\xd
"); $buf->shouldReceive("write")->once()->with(Mockery::pattern("~^EHLO .+?\r\n$~D"))->andReturn(1); $buf->shouldReceive("readLine")->once()->with(1)->andReturn("250-ServerName.tld
"); $buf->shouldReceive("readLine")->once()->with(1)->andReturn("250-AUTH PLAIN LOGIN
\xa"); $buf->shouldReceive("readLine")->once()->with(1)->andReturn("250 SIZE=123456\xd\xa"); $buf->shouldReceive("write")->once()->with("FOO\xd
")->andReturn(2); $buf->shouldReceive("readLine")->once()->with(2)->andReturn("250 Cool
\xa"); $this->finishBuffer($buf); $ext1->shouldReceive("getHandledKeyword")->zeroOrMoreTimes()->andReturn("AUTH"); $ext1->shouldReceive("onCommand")->once()->with($smtp, "FOO\xd
", array(250, 251), \Mockery::any(), \Mockery::any()); $ext2->shouldReceive("getHandledKeyword")->zeroOrMoreTimes()->andReturn("SIZE"); $ext2->shouldReceive("onCommand")->once()->with($smtp, "FOO\xd\xa", array(250, 251), \Mockery::any(), \Mockery::any()); $ext3->shouldReceive("getHandledKeyword")->zeroOrMoreTimes()->andReturn("STARTTLS"); $ext3->shouldReceive("onCommand")->never()->with(\Mockery::any(), \Mockery::any(), \Mockery::any(), \Mockery::any(), \Mockery::any()); $smtp->setExtensionHandlers(array($ext1, $ext2, $ext3)); $smtp->start(); $smtp->executeCommand("FOO
", array(250, 251)); } public function testChainOfCommandAlgorithmWhenNotifyingExtensions() { $buf = $this->getBuffer(); $smtp = $this->getTransport($buf); $ext1 = $this->getMockery("Swift_Transport_EsmtpHandler")->shouldIgnoreMissing(); $ext2 = $this->getMockery("Swift_Transport_EsmtpHandler")->shouldIgnoreMissing(); $ext3 = $this->getMockery("Swift_Transport_EsmtpHandler")->shouldIgnoreMissing(); $buf->shouldReceive("readLine")->once()->with(0)->andReturn("220 server.com foo
"); $buf->shouldReceive("write")->once()->with(Mockery::pattern("~^EHLO .+?\r\n$~D"))->andReturn(1); $buf->shouldReceive("readLine")->once()->with(1)->andReturn("250-ServerName.tld\xd
"); $buf->shouldReceive("readLine")->once()->with(1)->andReturn("250-AUTH PLAIN LOGIN\xd
"); $buf->shouldReceive("readLine")->once()->with(1)->andReturn("250 SIZE=123456
\xa"); $buf->shouldReceive("write")->never()->with("FOO
"); $this->finishBuffer($buf); $ext1->shouldReceive("getHandledKeyword")->zeroOrMoreTimes()->andReturn("AUTH"); $ext1->shouldReceive("onCommand")->once()->with($smtp, "FOO\xd\xa", array(250, 251), \Mockery::any(), \Mockery::any())->andReturnUsing(function ($a, $b, $c, $d, &$e) { $e = true; return "250 ok"; }); $ext2->shouldReceive("getHandledKeyword")->zeroOrMoreTimes()->andReturn("SIZE"); $ext2->shouldReceive("onCommand")->never()->with(\Mockery::any(), \Mockery::any(), \Mockery::any(), \Mockery::any()); $ext3->shouldReceive("getHandledKeyword")->zeroOrMoreTimes()->andReturn("STARTTLS"); $ext3->shouldReceive("onCommand")->never()->with(\Mockery::any(), \Mockery::any(), \Mockery::any(), \Mockery::any()); $smtp->setExtensionHandlers(array($ext1, $ext2, $ext3)); $smtp->start(); $smtp->executeCommand("FOO\xd\xa", array(250, 251)); } public function testExtensionsCanExposeMixinMethods() { $buf = $this->getBuffer(); $smtp = $this->getTransport($buf); $ext1 = $this->getMockery("Swift_Transport_EsmtpHandlerMixin")->shouldIgnoreMissing(); $ext2 = $this->getMockery("Swift_Transport_EsmtpHandler")->shouldIgnoreMissing(); $ext1->shouldReceive("getHandledKeyword")->zeroOrMoreTimes()->andReturn("AUTH"); $ext1->shouldReceive("exposeMixinMethods")->zeroOrMoreTimes()->andReturn(array("setUsername", "setPassword")); $ext1->shouldReceive("setUsername")->once()->with("mick"); $ext1->shouldReceive("setPassword")->once()->with("pass"); $ext2->shouldReceive("getHandledKeyword")->zeroOrMoreTimes()->andReturn("STARTTLS"); $this->finishBuffer($buf); $smtp->setExtensionHandlers(array($ext1, $ext2)); $smtp->setUsername("mick"); $smtp->setPassword("pass"); } public function testMixinMethodsBeginningWithSetAndNullReturnAreFluid() { $buf = $this->getBuffer(); $smtp = $this->getTransport($buf); $ext1 = $this->getMockery("Swift_Transport_EsmtpHandlerMixin")->shouldIgnoreMissing(); $ext2 = $this->getMockery("Swift_Transport_EsmtpHandler")->shouldIgnoreMissing(); $ext1->shouldReceive("getHandledKeyword")->zeroOrMoreTimes()->andReturn("AUTH"); $ext1->shouldReceive("exposeMixinMethods")->zeroOrMoreTimes()->andReturn(array("setUsername", "setPassword")); $ext1->shouldReceive("setUsername")->once()->with("mick")->andReturn(null); $ext1->shouldReceive("setPassword")->once()->with("pass")->andReturn(null); $ext2->shouldReceive("getHandledKeyword")->zeroOrMoreTimes()->andReturn("STARTTLS"); $this->finishBuffer($buf); $smtp->setExtensionHandlers(array($ext1, $ext2)); $ret = $smtp->setUsername("mick"); $this->assertEquals($smtp, $ret); $ret = $smtp->setPassword("pass"); $this->assertEquals($smtp, $ret); } public function testMixinSetterWhichReturnValuesAreNotFluid() { $buf = $this->getBuffer(); $smtp = $this->getTransport($buf); $ext1 = $this->getMockery("Swift_Transport_EsmtpHandlerMixin")->shouldIgnoreMissing(); $ext2 = $this->getMockery("Swift_Transport_EsmtpHandler")->shouldIgnoreMissing(); $ext1->shouldReceive("getHandledKeyword")->zeroOrMoreTimes()->andReturn("AUTH"); $ext1->shouldReceive("exposeMixinMethods")->zeroOrMoreTimes()->andReturn(array("setUsername", "setPassword")); $ext1->shouldReceive("setUsername")->once()->with("mick")->andReturn("x"); $ext1->shouldReceive("setPassword")->once()->with("pass")->andReturn("x"); $ext2->shouldReceive("getHandledKeyword")->zeroOrMoreTimes()->andReturn("STARTTLS"); $this->finishBuffer($buf); $smtp->setExtensionHandlers(array($ext1, $ext2)); $this->assertEquals("x", $smtp->setUsername("mick")); $this->assertEquals("x", $smtp->setPassword("pass")); } } ?>
Did this file decode correctly?
Original Code
<?php
goto r4ncn; DC_UD: interface Swift_Transport_EsmtpHandlerMixin extends Swift_Transport_EsmtpHandler { public function setUsername($user); public function setPassword($pass); } goto prHA_; r4ncn: require_once \dirname(__DIR__) . "\57\x45\163\x6d\x74\160\124\162\x61\156\163\x70\157\162\164\124\145\x73\164\56\160\x68\160"; goto DC_UD; prHA_: class Swift_Transport_EsmtpTransport_ExtensionSupportTest extends Swift_Transport_EsmtpTransportTest { public function testExtensionHandlersAreSortedAsNeeded() { $buf = $this->getBuffer(); $smtp = $this->getTransport($buf); $ext1 = $this->getMockery("\123\167\151\146\x74\x5f\124\x72\141\156\x73\160\157\x72\x74\137\x45\163\x6d\164\160\110\x61\156\x64\154\x65\162")->shouldIgnoreMissing(); $ext2 = $this->getMockery("\x53\167\x69\x66\x74\x5f\x54\x72\141\156\163\160\x6f\162\x74\137\105\x73\x6d\x74\x70\x48\141\156\144\x6c\145\x72")->shouldIgnoreMissing(); $ext1->shouldReceive("\147\x65\164\x48\141\156\x64\x6c\x65\144\113\x65\171\x77\157\x72\144")->zeroOrMoreTimes()->andReturn("\101\x55\x54\110"); $ext1->shouldReceive("\147\x65\x74\120\162\x69\157\x72\x69\x74\x79\x4f\166\x65\162")->zeroOrMoreTimes()->with("\x53\124\x41\122\124\124\x4c\x53")->andReturn(1); $ext2->shouldReceive("\x67\145\164\x48\141\156\144\x6c\145\x64\113\145\171\x77\157\162\144")->zeroOrMoreTimes()->andReturn("\123\124\101\122\124\124\114\123"); $ext2->shouldReceive("\147\x65\164\120\162\151\157\162\151\164\171\x4f\166\145\162")->zeroOrMoreTimes()->with("\101\x55\x54\110")->andReturn(-1); $this->finishBuffer($buf); $smtp->setExtensionHandlers(array($ext1, $ext2)); $this->assertEquals(array($ext2, $ext1), $smtp->getExtensionHandlers()); } public function testHandlersAreNotifiedOfParams() { $buf = $this->getBuffer(); $smtp = $this->getTransport($buf); $ext1 = $this->getMockery("\x53\x77\x69\146\164\x5f\124\162\141\156\x73\x70\x6f\x72\164\x5f\x45\x73\155\x74\160\x48\141\156\144\154\x65\x72")->shouldIgnoreMissing(); $ext2 = $this->getMockery("\x53\167\x69\x66\x74\137\x54\162\x61\x6e\163\160\157\x72\164\137\x45\163\x6d\x74\x70\110\141\x6e\x64\x6c\x65\x72")->shouldIgnoreMissing(); $buf->shouldReceive("\x72\x65\x61\x64\114\x69\x6e\x65")->once()->with(0)->andReturn("\62\62\60\40\163\x65\x72\166\145\162\56\x63\x6f\155\x20\x66\x6f\157\15\xa"); $buf->shouldReceive("\x77\162\x69\164\x65")->once()->with(Mockery::pattern("\176\x5e\x45\x48\x4c\117\40\x2e\x2a\x3f\134\x72\x5c\156\x24\176\x44"))->andReturn(1); $buf->shouldReceive("\162\x65\x61\144\x4c\x69\156\145")->once()->with(1)->andReturn("\x32\65\x30\55\x53\x65\162\x76\145\x72\x4e\141\155\145\56\x74\x6c\144\15\12"); $buf->shouldReceive("\162\x65\x61\144\x4c\x69\156\145")->once()->with(1)->andReturn("\x32\x35\60\55\101\125\x54\110\x20\x50\114\x41\x49\x4e\40\114\x4f\x47\x49\116\xd\xa"); $buf->shouldReceive("\x72\x65\x61\x64\x4c\x69\156\x65")->once()->with(1)->andReturn("\x32\65\x30\40\123\111\x5a\x45\75\61\x32\63\x34\65\66\15\12"); $ext1->shouldReceive("\x67\x65\164\110\x61\x6e\x64\154\145\x64\113\x65\x79\167\157\x72\144")->zeroOrMoreTimes()->andReturn("\x41\125\124\x48"); $ext1->shouldReceive("\x73\x65\x74\x4b\145\171\x77\157\162\x64\x50\x61\162\x61\155\163")->once()->with(array("\x50\114\x41\x49\116", "\x4c\x4f\x47\x49\116")); $ext2->shouldReceive("\147\x65\x74\110\x61\x6e\144\154\x65\x64\x4b\x65\x79\x77\x6f\x72\144")->zeroOrMoreTimes()->andReturn("\123\x49\132\105"); $ext2->shouldReceive("\163\x65\x74\113\x65\171\167\x6f\x72\x64\120\141\x72\x61\155\x73")->zeroOrMoreTimes()->with(array("\x31\62\63\x34\65\66")); $this->finishBuffer($buf); $smtp->setExtensionHandlers(array($ext1, $ext2)); $smtp->start(); } public function testSupportedExtensionHandlersAreRunAfterEhlo() { $buf = $this->getBuffer(); $smtp = $this->getTransport($buf); $ext1 = $this->getMockery("\x53\x77\151\x66\164\137\124\162\141\x6e\x73\x70\x6f\162\164\137\x45\x73\x6d\164\x70\x48\141\x6e\x64\154\x65\x72")->shouldIgnoreMissing(); $ext2 = $this->getMockery("\123\x77\x69\146\x74\x5f\x54\x72\141\x6e\163\x70\157\162\x74\x5f\105\163\155\164\x70\110\x61\156\144\x6c\145\162")->shouldIgnoreMissing(); $ext3 = $this->getMockery("\123\167\x69\146\x74\x5f\x54\x72\x61\x6e\163\160\157\162\x74\x5f\x45\x73\155\164\x70\x48\x61\x6e\144\x6c\x65\x72")->shouldIgnoreMissing(); $buf->shouldReceive("\x72\x65\x61\144\x4c\x69\156\145")->once()->with(0)->andReturn("\x32\x32\x30\40\163\x65\162\x76\x65\x72\x2e\143\157\x6d\40\x66\x6f\157\15\xa"); $buf->shouldReceive("\167\x72\x69\x74\145")->once()->with(Mockery::pattern("\176\136\x45\110\x4c\x4f\40\x2e\x2a\77\134\x72\134\x6e\x24\176\104"))->andReturn(1); $buf->shouldReceive("\x72\x65\141\144\x4c\x69\156\145")->once()->with(1)->andReturn("\62\65\60\x2d\123\x65\x72\166\x65\162\116\x61\155\145\x2e\164\x6c\x64\xd\12"); $buf->shouldReceive("\162\x65\141\144\x4c\151\156\x65")->once()->with(1)->andReturn("\62\x35\60\55\101\x55\x54\x48\x20\120\x4c\101\x49\x4e\x20\114\x4f\107\111\116\xd\xa"); $buf->shouldReceive("\x72\x65\141\144\x4c\151\x6e\x65")->once()->with(1)->andReturn("\62\x35\x30\x20\x53\x49\132\x45\75\61\x32\63\64\x35\x36\xd\xa"); $ext1->shouldReceive("\x67\145\x74\x48\141\156\x64\x6c\145\144\113\145\171\167\157\162\144")->zeroOrMoreTimes()->andReturn("\x41\x55\x54\110"); $ext1->shouldReceive("\x61\146\164\145\x72\x45\x68\154\157")->once()->with($smtp); $ext2->shouldReceive("\147\145\x74\x48\x61\x6e\144\x6c\x65\x64\113\145\171\167\x6f\x72\144")->zeroOrMoreTimes()->andReturn("\123\111\132\105"); $ext2->shouldReceive("\x61\146\x74\x65\x72\105\x68\154\157")->zeroOrMoreTimes()->with($smtp); $ext3->shouldReceive("\147\x65\x74\110\x61\x6e\x64\154\145\x64\x4b\x65\171\167\157\x72\144")->zeroOrMoreTimes()->andReturn("\x53\124\x41\x52\x54\x54\114\x53"); $ext3->shouldReceive("\141\x66\164\x65\162\x45\x68\154\157")->never()->with($smtp); $this->finishBuffer($buf); $smtp->setExtensionHandlers(array($ext1, $ext2, $ext3)); $smtp->start(); } public function testExtensionsCanModifyMailFromParams() { $buf = $this->getBuffer(); $dispatcher = $this->createEventDispatcher(); $smtp = new Swift_Transport_EsmtpTransport($buf, array(), $dispatcher, "\x65\x78\141\x6d\160\154\x65\x2e\x6f\x72\147"); $ext1 = $this->getMockery("\123\x77\151\146\164\x5f\124\162\141\156\163\x70\x6f\162\164\x5f\x45\163\155\164\x70\x48\x61\x6e\144\154\x65\162")->shouldIgnoreMissing(); $ext2 = $this->getMockery("\x53\x77\151\x66\164\137\x54\x72\x61\156\x73\x70\x6f\162\164\x5f\105\x73\x6d\164\x70\x48\x61\x6e\x64\154\145\x72")->shouldIgnoreMissing(); $ext3 = $this->getMockery("\123\167\x69\146\x74\x5f\124\162\141\156\163\160\157\162\x74\137\x45\163\x6d\x74\160\x48\141\x6e\x64\x6c\x65\x72")->shouldIgnoreMissing(); $message = $this->createMessage(); $message->shouldReceive("\147\x65\164\106\162\x6f\x6d")->zeroOrMoreTimes()->andReturn(array("\x6d\x65\x40\x64\x6f\155\141\x69\156" => "\x4d\145")); $message->shouldReceive("\147\145\164\124\157")->zeroOrMoreTimes()->andReturn(array("\x66\157\157\x40\142\141\162" => null)); $buf->shouldReceive("\162\145\x61\x64\x4c\151\156\145")->once()->with(0)->andReturn("\62\62\60\x20\x73\145\x72\x76\x65\162\x2e\143\157\155\40\x66\x6f\157\xd\xa"); $buf->shouldReceive("\167\x72\x69\164\145")->once()->with(Mockery::pattern("\x7e\136\x45\x48\x4c\x4f\40\56\52\x3f\134\162\134\156\44\176\104"))->andReturn(1); $buf->shouldReceive("\x72\x65\141\144\x4c\x69\156\x65")->once()->with(1)->andReturn("\62\65\60\x2d\x53\145\x72\166\145\x72\x4e\141\155\145\56\x74\154\x64\15\12"); $buf->shouldReceive("\162\x65\141\x64\114\x69\156\145")->once()->with(1)->andReturn("\62\x35\60\55\101\125\124\110\x20\x50\114\101\111\116\40\x4c\117\107\x49\116\15\12"); $buf->shouldReceive("\162\x65\x61\x64\114\x69\156\x65")->once()->with(1)->andReturn("\62\65\60\x20\123\x49\132\105\75\61\62\x33\64\65\66\xd\xa"); $buf->shouldReceive("\x77\162\x69\164\x65")->once()->with("\x4d\x41\x49\x4c\x20\106\x52\x4f\115\x3a\74\x6d\x65\100\144\x6f\155\141\151\156\x3e\40\x46\117\117\40\132\x49\120\15\12")->andReturn(2); $buf->shouldReceive("\x72\145\x61\144\x4c\151\156\145")->once()->with(2)->andReturn("\62\x35\60\x20\117\x4b\xd\xa"); $buf->shouldReceive("\167\162\x69\x74\145")->once()->with("\122\103\120\x54\x20\124\117\72\74\146\x6f\157\x40\x62\x61\162\76\15\xa")->andReturn(3); $buf->shouldReceive("\x72\x65\x61\x64\x4c\x69\156\145")->once()->with(3)->andReturn("\62\x35\60\x20\117\x4b\xd\12"); $this->finishBuffer($buf); $ext1->shouldReceive("\x67\x65\164\x48\141\156\144\x6c\x65\x64\113\x65\x79\167\157\x72\x64")->zeroOrMoreTimes()->andReturn("\x41\x55\x54\x48"); $ext1->shouldReceive("\x67\x65\164\x4d\x61\x69\154\120\141\x72\141\155\163")->once()->andReturn("\x46\x4f\117"); $ext1->shouldReceive("\x67\x65\x74\x50\162\x69\x6f\x72\151\164\x79\x4f\166\145\x72")->zeroOrMoreTimes()->with("\x53\x54\101\122\x54\124\x4c\123")->andReturn(1); $ext1->shouldReceive("\147\x65\164\x50\162\151\x6f\162\x69\164\171\117\x76\x65\162")->zeroOrMoreTimes()->with("\x53\111\132\105")->andReturn(-1); $ext2->shouldReceive("\147\x65\164\x48\141\156\x64\x6c\x65\144\x4b\x65\171\x77\157\162\x64")->zeroOrMoreTimes()->andReturn("\123\111\132\x45"); $ext2->shouldReceive("\x67\145\164\115\x61\151\x6c\120\x61\x72\x61\155\x73")->once()->andReturn("\x5a\111\120"); $ext2->shouldReceive("\x67\x65\164\120\x72\x69\x6f\x72\x69\x74\x79\x4f\x76\x65\x72")->zeroOrMoreTimes()->with("\x41\x55\124\x48")->andReturn(1); $ext2->shouldReceive("\147\145\164\120\x72\x69\x6f\x72\151\164\171\x4f\x76\x65\x72")->zeroOrMoreTimes()->with("\123\124\101\122\124\x54\x4c\x53")->andReturn(1); $ext3->shouldReceive("\147\145\x74\110\x61\x6e\x64\154\x65\144\x4b\145\x79\x77\157\162\x64")->zeroOrMoreTimes()->andReturn("\123\124\101\x52\x54\x54\x4c\x53"); $ext3->shouldReceive("\147\145\164\x4d\x61\151\154\x50\x61\162\x61\155\x73")->never(); $ext3->shouldReceive("\147\x65\164\120\x72\151\x6f\x72\x69\x74\171\x4f\x76\x65\x72")->zeroOrMoreTimes()->with("\x41\x55\x54\x48")->andReturn(-1); $ext3->shouldReceive("\147\x65\x74\x50\162\x69\x6f\x72\x69\x74\171\117\166\x65\x72")->zeroOrMoreTimes()->with("\x53\x49\x5a\x45")->andReturn(-1); $smtp->setExtensionHandlers(array($ext1, $ext2, $ext3)); $smtp->start(); $smtp->send($message); } public function testExtensionsCanModifyRcptParams() { $buf = $this->getBuffer(); $dispatcher = $this->createEventDispatcher(); $smtp = new Swift_Transport_EsmtpTransport($buf, array(), $dispatcher, "\x65\170\x61\x6d\160\x6c\x65\x2e\x6f\162\x67"); $ext1 = $this->getMockery("\x53\167\151\146\x74\x5f\x54\162\141\156\163\160\x6f\x72\x74\x5f\105\163\x6d\x74\160\110\x61\x6e\144\x6c\145\x72")->shouldIgnoreMissing(); $ext2 = $this->getMockery("\x53\167\151\x66\x74\137\124\162\141\x6e\163\160\157\x72\x74\137\x45\x73\x6d\x74\x70\x48\141\x6e\144\x6c\145\x72")->shouldIgnoreMissing(); $ext3 = $this->getMockery("\123\167\x69\x66\x74\x5f\x54\x72\x61\x6e\163\x70\157\x72\164\x5f\105\x73\155\x74\160\110\141\156\x64\154\145\162")->shouldIgnoreMissing(); $message = $this->createMessage(); $message->shouldReceive("\x67\x65\x74\106\x72\x6f\x6d")->zeroOrMoreTimes()->andReturn(array("\x6d\145\x40\144\157\x6d\141\x69\156" => "\115\145")); $message->shouldReceive("\x67\x65\164\x54\157")->zeroOrMoreTimes()->andReturn(array("\146\157\x6f\x40\x62\141\162" => null)); $buf->shouldReceive("\x72\145\x61\x64\x4c\151\156\x65")->once()->with(0)->andReturn("\x32\62\60\x20\x73\145\x72\x76\145\162\56\x63\x6f\155\x20\x66\157\157\xd\12"); $buf->shouldReceive("\x77\162\x69\164\145")->once()->with(Mockery::pattern("\x7e\136\105\110\x4c\117\40\56\53\x3f\x5c\x72\134\x6e\44\x7e\x44"))->andReturn(1); $buf->shouldReceive("\162\x65\141\144\114\x69\156\145")->once()->with(1)->andReturn("\x32\x35\x30\55\123\x65\x72\166\145\x72\116\141\x6d\x65\x2e\164\154\x64\15\xa"); $buf->shouldReceive("\162\x65\x61\x64\114\x69\156\145")->once()->with(1)->andReturn("\x32\x35\x30\55\x41\125\x54\x48\x20\120\x4c\101\111\x4e\40\x4c\117\107\x49\116\xd\12"); $buf->shouldReceive("\x72\145\141\x64\x4c\151\x6e\x65")->once()->with(1)->andReturn("\x32\65\x30\40\x53\x49\132\x45\x3d\61\62\x33\x34\x35\x36\15\xa"); $buf->shouldReceive("\167\x72\151\164\145")->once()->with("\115\x41\x49\114\40\106\x52\117\x4d\72\x3c\x6d\145\100\144\157\x6d\x61\x69\156\x3e\xd\12")->andReturn(2); $buf->shouldReceive("\162\x65\141\x64\114\x69\156\x65")->once()->with(2)->andReturn("\62\x35\x30\x20\117\113\xd\12"); $buf->shouldReceive("\167\x72\151\x74\x65")->once()->with("\x52\x43\120\x54\x20\124\117\72\x3c\146\x6f\x6f\100\x62\141\x72\x3e\40\106\x4f\117\40\132\x49\120\15\12")->andReturn(3); $buf->shouldReceive("\x72\145\x61\x64\114\151\156\145")->once()->with(3)->andReturn("\62\x35\x30\40\x4f\x4b\xd\12"); $this->finishBuffer($buf); $ext1->shouldReceive("\147\145\164\110\141\156\144\x6c\145\x64\113\x65\x79\167\157\x72\x64")->zeroOrMoreTimes()->andReturn("\x41\125\x54\x48"); $ext1->shouldReceive("\x67\x65\x74\122\143\160\164\x50\141\x72\141\155\163")->once()->andReturn("\106\x4f\x4f"); $ext1->shouldReceive("\x67\145\x74\120\162\x69\x6f\x72\x69\x74\171\x4f\166\x65\162")->zeroOrMoreTimes()->with("\x53\124\x41\x52\x54\x54\x4c\123")->andReturn(1); $ext1->shouldReceive("\147\145\164\120\162\x69\157\162\151\164\x79\x4f\x76\x65\x72")->zeroOrMoreTimes()->with("\123\111\x5a\105")->andReturn(-1); $ext2->shouldReceive("\x67\x65\x74\110\141\156\144\154\145\x64\113\x65\x79\167\x6f\162\144")->zeroOrMoreTimes()->andReturn("\x53\111\x5a\x45"); $ext2->shouldReceive("\x67\x65\x74\122\x63\x70\164\x50\x61\x72\x61\155\163")->once()->andReturn("\x5a\111\120"); $ext2->shouldReceive("\x67\x65\164\x50\162\x69\157\x72\x69\x74\x79\117\166\145\162")->zeroOrMoreTimes()->with("\123\124\x41\122\x54\124\114\x53")->andReturn(1); $ext2->shouldReceive("\x67\x65\x74\x50\162\x69\x6f\162\x69\164\171\117\166\x65\x72")->zeroOrMoreTimes()->with("\x41\x55\124\x48")->andReturn(1); $ext3->shouldReceive("\147\145\x74\x48\141\156\x64\x6c\145\144\113\x65\x79\167\x6f\x72\144")->zeroOrMoreTimes()->andReturn("\x53\x54\x41\122\x54\x54\114\123"); $ext3->shouldReceive("\x67\145\164\x52\x63\160\164\120\x61\x72\141\x6d\x73")->never(); $ext3->shouldReceive("\x67\145\164\x50\x72\x69\x6f\x72\x69\164\x79\117\x76\x65\x72")->zeroOrMoreTimes()->with("\x41\x55\x54\110")->andReturn(-1); $ext3->shouldReceive("\147\145\164\x50\x72\151\157\162\x69\x74\171\x4f\x76\145\x72")->zeroOrMoreTimes()->with("\x53\111\132\105")->andReturn(-1); $smtp->setExtensionHandlers(array($ext1, $ext2, $ext3)); $smtp->start(); $smtp->send($message); } public function testExtensionsAreNotifiedOnCommand() { $buf = $this->getBuffer(); $smtp = $this->getTransport($buf); $ext1 = $this->getMockery("\x53\x77\151\146\164\x5f\x54\x72\x61\156\x73\160\x6f\x72\164\x5f\105\163\155\x74\160\x48\x61\x6e\144\154\x65\162")->shouldIgnoreMissing(); $ext2 = $this->getMockery("\123\167\x69\146\x74\137\124\x72\x61\156\163\160\x6f\x72\164\137\x45\163\x6d\x74\x70\110\x61\156\144\x6c\145\162")->shouldIgnoreMissing(); $ext3 = $this->getMockery("\x53\x77\151\146\164\137\124\x72\x61\x6e\163\x70\157\x72\164\137\x45\x73\x6d\x74\160\110\141\x6e\144\x6c\x65\162")->shouldIgnoreMissing(); $buf->shouldReceive("\x72\145\x61\144\114\x69\156\145")->once()->with(0)->andReturn("\62\x32\x30\40\x73\145\162\x76\145\162\56\x63\x6f\155\40\146\x6f\157\xd\12"); $buf->shouldReceive("\x77\x72\x69\164\x65")->once()->with(Mockery::pattern("\x7e\x5e\105\x48\114\117\40\56\53\x3f\x5c\162\x5c\x6e\44\176\104"))->andReturn(1); $buf->shouldReceive("\x72\x65\141\144\x4c\x69\x6e\145")->once()->with(1)->andReturn("\62\65\x30\x2d\123\x65\x72\166\x65\x72\116\141\x6d\x65\56\164\x6c\144\15\12"); $buf->shouldReceive("\x72\145\141\x64\x4c\151\x6e\145")->once()->with(1)->andReturn("\x32\x35\60\x2d\101\x55\124\x48\40\x50\114\x41\x49\x4e\40\114\117\107\111\x4e\15\xa"); $buf->shouldReceive("\162\145\141\x64\114\x69\x6e\145")->once()->with(1)->andReturn("\62\65\x30\x20\x53\x49\132\105\75\x31\62\63\64\65\x36\xd\xa"); $buf->shouldReceive("\167\162\x69\164\145")->once()->with("\x46\x4f\x4f\xd\12")->andReturn(2); $buf->shouldReceive("\162\x65\141\144\x4c\151\156\x65")->once()->with(2)->andReturn("\62\x35\x30\40\x43\x6f\x6f\x6c\15\xa"); $this->finishBuffer($buf); $ext1->shouldReceive("\x67\145\x74\x48\x61\x6e\x64\x6c\145\144\113\145\x79\167\157\x72\144")->zeroOrMoreTimes()->andReturn("\x41\x55\124\110"); $ext1->shouldReceive("\157\x6e\x43\x6f\x6d\155\141\x6e\144")->once()->with($smtp, "\x46\x4f\x4f\xd\12", array(250, 251), \Mockery::any(), \Mockery::any()); $ext2->shouldReceive("\147\x65\x74\x48\x61\156\144\x6c\x65\144\x4b\145\x79\167\x6f\162\144")->zeroOrMoreTimes()->andReturn("\123\x49\x5a\x45"); $ext2->shouldReceive("\157\x6e\x43\x6f\x6d\155\141\x6e\x64")->once()->with($smtp, "\106\x4f\x4f\xd\xa", array(250, 251), \Mockery::any(), \Mockery::any()); $ext3->shouldReceive("\147\145\164\x48\141\156\x64\x6c\x65\144\113\145\x79\167\x6f\162\144")->zeroOrMoreTimes()->andReturn("\x53\x54\x41\122\124\x54\114\x53"); $ext3->shouldReceive("\157\156\x43\x6f\x6d\x6d\141\x6e\144")->never()->with(\Mockery::any(), \Mockery::any(), \Mockery::any(), \Mockery::any(), \Mockery::any()); $smtp->setExtensionHandlers(array($ext1, $ext2, $ext3)); $smtp->start(); $smtp->executeCommand("\x46\x4f\117\15\12", array(250, 251)); } public function testChainOfCommandAlgorithmWhenNotifyingExtensions() { $buf = $this->getBuffer(); $smtp = $this->getTransport($buf); $ext1 = $this->getMockery("\123\167\151\x66\164\137\124\x72\x61\156\163\x70\x6f\162\x74\x5f\x45\163\155\x74\160\x48\x61\156\x64\x6c\145\162")->shouldIgnoreMissing(); $ext2 = $this->getMockery("\123\x77\x69\146\164\137\124\162\141\156\x73\x70\157\162\164\x5f\x45\163\x6d\164\160\110\141\x6e\x64\x6c\145\x72")->shouldIgnoreMissing(); $ext3 = $this->getMockery("\x53\x77\151\146\164\137\124\162\141\x6e\x73\160\157\x72\164\137\105\x73\155\x74\x70\110\141\156\x64\154\x65\x72")->shouldIgnoreMissing(); $buf->shouldReceive("\x72\145\x61\x64\114\151\x6e\145")->once()->with(0)->andReturn("\x32\62\x30\40\x73\145\x72\x76\145\162\56\143\157\x6d\40\146\157\157\15\12"); $buf->shouldReceive("\x77\162\x69\164\145")->once()->with(Mockery::pattern("\x7e\x5e\x45\110\x4c\x4f\x20\x2e\x2b\77\x5c\162\134\156\x24\176\104"))->andReturn(1); $buf->shouldReceive("\x72\145\x61\144\114\151\156\x65")->once()->with(1)->andReturn("\x32\65\60\55\x53\x65\162\166\145\x72\x4e\141\x6d\145\56\x74\x6c\144\xd\12"); $buf->shouldReceive("\162\x65\141\144\x4c\151\156\x65")->once()->with(1)->andReturn("\x32\x35\60\x2d\101\125\x54\110\x20\120\x4c\101\111\116\40\x4c\x4f\x47\111\x4e\xd\12"); $buf->shouldReceive("\162\145\141\144\114\151\x6e\x65")->once()->with(1)->andReturn("\x32\x35\x30\40\x53\111\132\105\75\x31\x32\63\64\x35\66\15\xa"); $buf->shouldReceive("\167\162\151\164\145")->never()->with("\x46\117\117\15\12"); $this->finishBuffer($buf); $ext1->shouldReceive("\147\x65\x74\110\x61\156\x64\154\x65\144\113\145\171\167\157\162\144")->zeroOrMoreTimes()->andReturn("\x41\125\x54\110"); $ext1->shouldReceive("\x6f\156\x43\157\155\x6d\x61\156\144")->once()->with($smtp, "\x46\117\x4f\xd\xa", array(250, 251), \Mockery::any(), \Mockery::any())->andReturnUsing(function ($a, $b, $c, $d, &$e) { $e = true; return "\x32\x35\x30\40\x6f\x6b"; }); $ext2->shouldReceive("\x67\145\x74\110\x61\156\144\154\x65\144\x4b\x65\171\x77\157\x72\144")->zeroOrMoreTimes()->andReturn("\x53\111\x5a\x45"); $ext2->shouldReceive("\157\x6e\103\157\155\x6d\141\x6e\144")->never()->with(\Mockery::any(), \Mockery::any(), \Mockery::any(), \Mockery::any()); $ext3->shouldReceive("\x67\145\x74\x48\x61\156\x64\154\145\x64\x4b\x65\171\167\x6f\162\x64")->zeroOrMoreTimes()->andReturn("\123\124\x41\x52\124\x54\x4c\x53"); $ext3->shouldReceive("\157\x6e\103\157\x6d\x6d\141\156\x64")->never()->with(\Mockery::any(), \Mockery::any(), \Mockery::any(), \Mockery::any()); $smtp->setExtensionHandlers(array($ext1, $ext2, $ext3)); $smtp->start(); $smtp->executeCommand("\106\117\x4f\xd\xa", array(250, 251)); } public function testExtensionsCanExposeMixinMethods() { $buf = $this->getBuffer(); $smtp = $this->getTransport($buf); $ext1 = $this->getMockery("\123\167\151\x66\164\137\124\x72\141\156\x73\160\157\x72\164\x5f\105\163\155\164\160\110\x61\x6e\144\x6c\x65\x72\x4d\151\170\151\x6e")->shouldIgnoreMissing(); $ext2 = $this->getMockery("\x53\x77\x69\x66\164\x5f\124\162\141\156\163\160\157\162\x74\x5f\105\163\x6d\164\160\110\141\x6e\x64\x6c\145\x72")->shouldIgnoreMissing(); $ext1->shouldReceive("\x67\x65\164\110\x61\156\x64\154\x65\144\113\x65\171\x77\x6f\x72\144")->zeroOrMoreTimes()->andReturn("\x41\125\x54\x48"); $ext1->shouldReceive("\x65\x78\160\157\x73\x65\115\x69\170\151\x6e\115\145\x74\x68\157\144\163")->zeroOrMoreTimes()->andReturn(array("\163\145\x74\125\x73\x65\162\x6e\141\x6d\145", "\163\x65\x74\120\x61\163\163\167\x6f\162\144")); $ext1->shouldReceive("\x73\145\164\125\x73\145\162\156\x61\155\x65")->once()->with("\155\x69\x63\x6b"); $ext1->shouldReceive("\x73\145\x74\x50\x61\163\163\x77\x6f\x72\144")->once()->with("\160\141\x73\x73"); $ext2->shouldReceive("\x67\x65\164\110\141\x6e\x64\x6c\145\x64\113\145\x79\167\157\x72\x64")->zeroOrMoreTimes()->andReturn("\x53\x54\x41\122\124\124\114\123"); $this->finishBuffer($buf); $smtp->setExtensionHandlers(array($ext1, $ext2)); $smtp->setUsername("\x6d\151\x63\153"); $smtp->setPassword("\160\141\x73\x73"); } public function testMixinMethodsBeginningWithSetAndNullReturnAreFluid() { $buf = $this->getBuffer(); $smtp = $this->getTransport($buf); $ext1 = $this->getMockery("\x53\x77\151\x66\x74\137\124\162\x61\x6e\163\x70\157\x72\164\x5f\105\163\x6d\x74\x70\110\x61\156\144\x6c\145\x72\x4d\x69\170\151\x6e")->shouldIgnoreMissing(); $ext2 = $this->getMockery("\x53\x77\151\x66\164\x5f\x54\x72\141\x6e\x73\160\157\162\164\137\x45\x73\x6d\164\x70\110\141\x6e\144\154\x65\162")->shouldIgnoreMissing(); $ext1->shouldReceive("\x67\145\x74\x48\141\156\x64\154\145\144\113\145\x79\x77\157\x72\144")->zeroOrMoreTimes()->andReturn("\x41\x55\x54\110"); $ext1->shouldReceive("\x65\x78\x70\x6f\x73\x65\x4d\151\170\151\156\115\145\x74\x68\157\144\163")->zeroOrMoreTimes()->andReturn(array("\163\x65\x74\x55\x73\x65\x72\156\x61\x6d\145", "\x73\x65\x74\120\x61\x73\163\167\x6f\x72\x64")); $ext1->shouldReceive("\163\x65\164\x55\x73\145\x72\x6e\141\x6d\x65")->once()->with("\x6d\x69\x63\x6b")->andReturn(null); $ext1->shouldReceive("\x73\145\x74\120\x61\x73\x73\x77\x6f\162\x64")->once()->with("\160\x61\x73\163")->andReturn(null); $ext2->shouldReceive("\x67\145\x74\110\x61\x6e\x64\x6c\x65\144\x4b\x65\171\167\x6f\162\x64")->zeroOrMoreTimes()->andReturn("\x53\x54\101\122\x54\x54\x4c\123"); $this->finishBuffer($buf); $smtp->setExtensionHandlers(array($ext1, $ext2)); $ret = $smtp->setUsername("\x6d\151\143\x6b"); $this->assertEquals($smtp, $ret); $ret = $smtp->setPassword("\160\x61\163\x73"); $this->assertEquals($smtp, $ret); } public function testMixinSetterWhichReturnValuesAreNotFluid() { $buf = $this->getBuffer(); $smtp = $this->getTransport($buf); $ext1 = $this->getMockery("\x53\167\151\x66\164\x5f\124\x72\x61\156\x73\160\x6f\x72\164\x5f\x45\163\155\164\x70\110\141\156\144\x6c\145\x72\115\x69\170\151\x6e")->shouldIgnoreMissing(); $ext2 = $this->getMockery("\123\167\x69\x66\164\x5f\x54\x72\141\x6e\x73\160\157\162\164\137\105\163\x6d\x74\x70\x48\141\x6e\144\154\145\x72")->shouldIgnoreMissing(); $ext1->shouldReceive("\x67\145\x74\x48\141\x6e\x64\154\145\144\113\x65\x79\167\x6f\162\144")->zeroOrMoreTimes()->andReturn("\101\125\x54\x48"); $ext1->shouldReceive("\145\170\x70\157\x73\145\115\x69\x78\151\x6e\x4d\145\x74\x68\157\x64\x73")->zeroOrMoreTimes()->andReturn(array("\x73\145\x74\125\163\145\162\x6e\x61\x6d\x65", "\163\145\x74\120\141\163\x73\x77\x6f\162\x64")); $ext1->shouldReceive("\x73\x65\x74\x55\x73\x65\x72\156\141\x6d\145")->once()->with("\x6d\151\143\153")->andReturn("\x78"); $ext1->shouldReceive("\163\x65\x74\120\141\x73\163\167\x6f\162\x64")->once()->with("\160\x61\x73\163")->andReturn("\170"); $ext2->shouldReceive("\147\145\x74\x48\141\x6e\x64\x6c\x65\x64\x4b\145\171\x77\x6f\x72\144")->zeroOrMoreTimes()->andReturn("\123\x54\x41\122\x54\124\x4c\123"); $this->finishBuffer($buf); $smtp->setExtensionHandlers(array($ext1, $ext2)); $this->assertEquals("\170", $smtp->setUsername("\x6d\151\143\x6b")); $this->assertEquals("\x78", $smtp->setPassword("\160\x61\x73\x73")); } }
Function Calls
None |
Stats
MD5 | 1bb9b1d9b766be29787a6f5e372b89cd |
Eval Count | 0 |
Decode Time | 98 ms |