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\Teardown;
17 * Represents hooked test teardown.
19 * @author Konstantin Kudryashov <ever.zet@gmail.com>
21 final class HookedTeardown implements Teardown
30 private $hookCallResults;
35 * @param Teardown $teardown
36 * @param CallResults $hookCallResults
38 public function __construct(Teardown $teardown, CallResults $hookCallResults)
40 $this->teardown = $teardown;
41 $this->hookCallResults = $hookCallResults;
47 public function isSuccessful()
49 if ($this->hookCallResults->hasExceptions()) {
53 return $this->teardown->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;