PhpSpec\Runner\Maintainer\Maintainer::teardown PHP Method

teardown() public method

public teardown ( ExampleNode $example, PhpSpec\Specification $context, MatcherManager $matchers, CollaboratorManager $collaborators )
$example PhpSpec\Loader\Node\ExampleNode
$context PhpSpec\Specification
$matchers PhpSpec\Runner\MatcherManager
$collaborators PhpSpec\Runner\CollaboratorManager
    public function teardown(ExampleNode $example, Specification $context, MatcherManager $matchers, CollaboratorManager $collaborators);

Usage Example

Example #1
0
 function it_runs_all_supported_maintainers_before_and_after_each_example(ExampleNode $example, ReflectionMethod $exampReflection, Maintainer $maintainer)
 {
     $example->isPending()->willReturn(false);
     $exampReflection->getParameters()->willReturn(array());
     $exampReflection->invokeArgs(Argument::cetera())->willReturn(null);
     $maintainer->getPriority()->willReturn(1);
     $maintainer->supports($example)->willReturn(true);
     $maintainer->prepare($example, Argument::cetera())->shouldBeCalled();
     $maintainer->teardown($example, Argument::cetera())->shouldBeCalled();
     $this->registerMaintainer($maintainer);
     $this->run($example);
 }