public function testEndTestSuiteDestruct()
{
$clearProperties = new Magento_Test_ClearProperties();
$phpUnitTestSuite = new PHPUnit_Framework_TestSuite();
$phpUnitTestSuite->addTestFile(__DIR__ . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'DummyTestCase.php');
// Because addTestFile() adds classes from file to tests array, use first testsuite
/** @var $testSuite PHPUnit_Framework_TestSuite */
$testSuite = $phpUnitTestSuite->testAt(0);
$testSuite->run();
$testClass = $testSuite->testAt(0);
foreach ($this->_properties as $property) {
if ($property['is_static']) {
$this->assertAttributeEquals($property['expectedValue'], $property['name'], get_class($testClass));
} else {
$this->assertAttributeEquals($property['expectedValue'], $property['name'], $testClass);
}
}
$clearProperties->endTestSuite($testSuite);
$this->assertTrue(Magento_Test_ClearProperties_Stub::$isDestructCalled);
foreach ($this->_properties as $property) {
if ($property['is_static']) {
$this->assertAttributeEmpty($property['name'], get_class($testClass));
} else {
$this->assertAttributeEmpty($property['name'], $testClass);
}
}
}