Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
SetupTermEntityStep.php
Go to the documentation of this file.
1 <?php
7 
9 use Magento\Mtf\TestStep\TestStepInterface;
10 
14 class SetupTermEntityStep implements TestStepInterface
15 {
21  protected $agreement;
22 
29 
34  public function __construct(
36  CheckoutAgreement $agreement
37  ) {
38  $this->deleteAllTermsEntityStep = $deleteAllTermsEntityStep;
39  $this->agreement = $agreement;
40  }
41 
47  public function run()
48  {
49  $this->agreement->persist();
50  return ['agreement' => $this->agreement];
51  }
52 
58  public function cleanup()
59  {
60  $this->deleteAllTermsEntityStep->run();
61  }
62 }
__construct(DeleteAllTermsEntityStep $deleteAllTermsEntityStep, CheckoutAgreement $agreement)