X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fbehat%2Fbehat%2Fsrc%2FBehat%2FTestwork%2FHook%2FTester%2FSetup%2FHookedSetup.php;fp=vendor%2Fbehat%2Fbehat%2Fsrc%2FBehat%2FTestwork%2FHook%2FTester%2FSetup%2FHookedSetup.php;h=3ba4478f03791a5fa9f607b70c20a5e1b87949c5;hp=0000000000000000000000000000000000000000;hb=1270d9129ce8f27c9b28b10518e32132c58e0aca;hpb=c27c0f0cdaa3f354b1fe54a56ae7e854be6e3f68 diff --git a/vendor/behat/behat/src/Behat/Testwork/Hook/Tester/Setup/HookedSetup.php b/vendor/behat/behat/src/Behat/Testwork/Hook/Tester/Setup/HookedSetup.php new file mode 100644 index 000000000..3ba4478f0 --- /dev/null +++ b/vendor/behat/behat/src/Behat/Testwork/Hook/Tester/Setup/HookedSetup.php @@ -0,0 +1,73 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Behat\Testwork\Hook\Tester\Setup; + +use Behat\Testwork\Call\CallResults; +use Behat\Testwork\Tester\Setup\Setup; + +/** + * Represents hooked test setup. + * + * @author Konstantin Kudryashov + */ +final class HookedSetup implements Setup +{ + /** + * @var Setup + */ + private $setup; + /** + * @var CallResults + */ + private $hookCallResults; + + /** + * Initializes setup. + * + * @param Setup $setup + * @param CallResults $hookCallResults + */ + public function __construct(Setup $setup, CallResults $hookCallResults) + { + $this->setup = $setup; + $this->hookCallResults = $hookCallResults; + } + + /** + * {@inheritdoc} + */ + public function isSuccessful() + { + if ($this->hookCallResults->hasExceptions()) { + return false; + } + + return $this->setup->isSuccessful(); + } + + /** + * {@inheritdoc} + */ + public function hasOutput() + { + return $this->hookCallResults->hasStdOuts() || $this->hookCallResults->hasExceptions(); + } + + /** + * Returns hook call results. + * + * @return CallResults + */ + public function getHookCallResults() + { + return $this->hookCallResults; + } +}