Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
TestCaseProperties.php
Go to the documentation of this file.
1 <?php
11 
13 {
19  public function endTestSuite(\PHPUnit\Framework\TestSuite $suite)
20  {
21  $tests = $suite->tests();
22 
23  foreach ($tests as $test) {
24  $reflectionClass = new \ReflectionClass($test);
25  $properties = $reflectionClass->getProperties();
26  foreach ($properties as $property) {
27  $property->setAccessible(true);
28  $value = $property->getValue($test);
29  if (is_object($value) && method_exists($value, '__destruct') && is_callable([$value, '__destruct'])) {
30  $value->__destruct();
31  }
32  $property->setValue($test, null);
33  }
34  }
35  }
36 }
$value
Definition: gender.phtml:16
$reflectionClass
Definition: categories.php:25
$properties
Definition: categories.php:26