4 * This file is part of the Behat.
5 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
11 namespace Behat\Testwork\Hook\Tester\Setup;
13 use Behat\Testwork\Call\CallResults;
14 use Behat\Testwork\Tester\Setup\Setup;
17 * Represents hooked test setup.
19 * @author Konstantin Kudryashov <ever.zet@gmail.com>
21 final class HookedSetup implements Setup
30 private $hookCallResults;
36 * @param CallResults $hookCallResults
38 public function __construct(Setup $setup, CallResults $hookCallResults)
40 $this->setup = $setup;
41 $this->hookCallResults = $hookCallResults;
47 public function isSuccessful()
49 if ($this->hookCallResults->hasExceptions()) {
53 return $this->setup->isSuccessful();
59 public function hasOutput()
61 return $this->hookCallResults->hasStdOuts() || $this->hookCallResults->hasExceptions();
65 * Returns hook call results.
69 public function getHookCallResults()
71 return $this->hookCallResults;