X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fbehat%2Fbehat%2Fsrc%2FBehat%2FTestwork%2FCall%2FCallResult.php;fp=vendor%2Fbehat%2Fbehat%2Fsrc%2FBehat%2FTestwork%2FCall%2FCallResult.php;h=ca3c528374c0f48c660e2cd9ec01d5cf64bfca14;hp=0000000000000000000000000000000000000000;hb=1270d9129ce8f27c9b28b10518e32132c58e0aca;hpb=c27c0f0cdaa3f354b1fe54a56ae7e854be6e3f68 diff --git a/vendor/behat/behat/src/Behat/Testwork/Call/CallResult.php b/vendor/behat/behat/src/Behat/Testwork/Call/CallResult.php new file mode 100644 index 000000000..ca3c52837 --- /dev/null +++ b/vendor/behat/behat/src/Behat/Testwork/Call/CallResult.php @@ -0,0 +1,114 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Behat\Testwork\Call; + +use Exception; + +/** + * Represents result of the call. + * + * @author Konstantin Kudryashov + */ +final class CallResult +{ + /** + * @var Call + */ + private $call; + /** + * @var mixed + */ + private $return; + /** + * @var null|Exception + */ + private $exception; + /** + * @var null|string + */ + private $stdOut; + + /** + * Initializes call result. + * + * @param Call $call + * @param mixed $return + * @param null|Exception $exception + * @param null|string $stdOut + */ + public function __construct(Call $call, $return, Exception $exception = null, $stdOut = null) + { + $this->call = $call; + $this->return = $return; + $this->exception = $exception; + $this->stdOut = $stdOut; + } + + /** + * Returns call. + * + * @return Call + */ + public function getCall() + { + return $this->call; + } + + /** + * Returns call return value. + * + * @return mixed + */ + public function getReturn() + { + return $this->return; + } + + /** + * Check if call thrown exception. + * + * @return Boolean + */ + public function hasException() + { + return null !== $this->exception; + } + + /** + * Returns exception thrown by call (if any). + * + * @return null|Exception + */ + public function getException() + { + return $this->exception; + } + + /** + * Checks if call produced stdOut. + * + * @return Boolean + */ + public function hasStdOut() + { + return null !== $this->stdOut; + } + + /** + * Returns stdOut produced by call (if any). + * + * @return null|string + */ + public function getStdOut() + { + return $this->stdOut; + } +}