diff --git a/core/modules/hal/src/Tests/NormalizerTestBase.php b/core/modules/hal/src/Tests/NormalizerTestBase.php index e933c43..68651f5 100644 --- a/core/modules/hal/src/Tests/NormalizerTestBase.php +++ b/core/modules/hal/src/Tests/NormalizerTestBase.php @@ -75,12 +75,8 @@ protected function setUp() { // Only check the modules, if the $modules property was not inherited. $rp = new \ReflectionProperty($class, 'modules'); if ($rp->class == $class) { - $entity_schema_to_install = array_intersect(array('node', 'comment'), $class::$modules); - if (!empty($entity_schema_to_install)) { - foreach($entity_schema_to_install as $module) { - $this->installEntitySchema($module); - } - break; + foreach (array_intersect(array('node', 'comment'), $class::$modules) as $module) { + $this->installEntitySchema($module); } } } diff --git a/core/modules/system/src/Tests/Entity/EntityUnitTestBase.php b/core/modules/system/src/Tests/Entity/EntityUnitTestBase.php index b321646..235373e 100644 --- a/core/modules/system/src/Tests/Entity/EntityUnitTestBase.php +++ b/core/modules/system/src/Tests/Entity/EntityUnitTestBase.php @@ -58,12 +58,8 @@ protected function setUp() { // Only check the modules, if the $modules property was not inherited. $rp = new \ReflectionProperty($class, 'modules'); if ($rp->class == $class) { - $entity_schema_to_install = array_intersect(array('node', 'comment'), $class::$modules); - if (!empty($entity_schema_to_install)) { - foreach($entity_schema_to_install as $module) { - $this->installEntitySchema($module); - } - break; + foreach (array_intersect(array('node', 'comment'), $class::$modules) as $module) { + $this->installEntitySchema($module); } } }