From 90ff32d56df26508cbab91c2e43048a09d83b160 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Thu, 6 Mar 2014 11:35:54 +0100 Subject: [PATCH] Tests for bug280. --- tests/Net/SSH2FunctionalTest.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/Net/SSH2FunctionalTest.php b/tests/Net/SSH2FunctionalTest.php index 34a9377b..3078bd40 100644 --- a/tests/Net/SSH2FunctionalTest.php +++ b/tests/Net/SSH2FunctionalTest.php @@ -41,5 +41,21 @@ class Net_SSH2FunctionalTest extends PhpseclibFunctionalTestCase $ssh->login($username, $password), 'SSH2 login using password failed.' ); + + return $ssh; + } + + /** + * @depends testPasswordLogin + * @group bug280 + */ + public function testExecWithMethodCallback($ssh) + { + $callbackObject = $this->getMock('stdClass', array('callbackMethod')); + $callbackObject + ->expects($this->atLeastOnce()) + ->method('callbackMethod') + ->will($this->returnValue(true)); + $ssh->exec('ls', array($callbackObject, 'callbackMethod')); } }