diff --git a/core/modules/simpletest/simpletest.module b/core/modules/simpletest/simpletest.module
index 4bec0f4..0a46873 100644
--- a/core/modules/simpletest/simpletest.module
+++ b/core/modules/simpletest/simpletest.module
@@ -788,7 +788,7 @@ function simpletest_phpunit_find_testcases($suite) {
     if ($testcase->getName() === 'testcase') {
       $testcases[] = $testcase;
     }
-    elseif (isset($testcase->testcase) && $testcase->tests > 0) {
+    elseif (isset($testcase->testcase) && ((int) $testcase->attributes()->tests) > 0) {
       foreach ($testcase->testcase as $childtestcase) {
         $testcases[] = $childtestcase;
       }
diff --git a/core/modules/simpletest/tests/Drupal/simpletest/Tests/phpunit_error.xml b/core/modules/simpletest/tests/Drupal/simpletest/Tests/phpunit_error.xml
index 9ce6f6b..a8cf4d9 100644
--- a/core/modules/simpletest/tests/Drupal/simpletest/Tests/phpunit_error.xml
+++ b/core/modules/simpletest/tests/Drupal/simpletest/Tests/phpunit_error.xml
@@ -17,27 +17,27 @@ Undefined index: foo
     </testsuite>
     <testsuite name="Drupal\Tests\Core\NestedArrayUnitTest" file="/home/chx/www/system/core/tests/Drupal/Tests/Core/NestedArrayUnitTest.php" namespace="Drupal\Tests\Core" fullPackage="Drupal.Tests.Core" tests="0" assertions="0" failures="0" errors="0" time="0.000000"/>
     <testsuite name="Drupal\breakpoint\Tests\BreakpointMediaQueryTest" file="/home/chx/www/system/core/modules/breakpoint/tests/Drupal/breakpoint/Tests/BreakpointMediaQueryTest.php" namespace="Drupal\breakpoint\Tests" fullPackage="Drupal.breakpoint.Tests" tests="0" assertions="0" failures="0" errors="0" time="0.000000"/>
-  </testsuite>
-  <testsuite name="Drupal\Tests\Core\Route\RouterRoleTest" file="/var/www/d8/core/tests/Drupal/Tests/Core/Route/RouterRoleTest.php" namespace="Drupal\Tests\Core\Route" fullPackage="Drupal.Tests.Core.Route" tests="3" assertions="3" failures="3" errors="0" time="0.009176">
-    <testsuite name="Drupal\Tests\Core\Route\RouterRoleTest::testRoleAccess" tests="3" assertions="3" failures="3" errors="0" time="0.009176">
-      <testcase name="testRoleAccess with data set #0" assertions="1" time="0.004519">
-        <failure type="PHPUnit_Framework_ExpectationFailedException">Drupal\Tests\Core\Route\RouterRoleTest::testRoleAccess with data set #0 ('role_test_1', array(Drupal\user\Plugin\Core\Entity\User, Drupal\user\Plugin\Core\Entity\User))
-          Access granted for user with the roles role_test_1 on path: role_test_1
-          Failed asserting that false is true.
-        </failure>
-      </testcase>
-      <testcase name="testRoleAccess with data set #1" assertions="1" time="0.002354">
-        <failure type="PHPUnit_Framework_ExpectationFailedException">Drupal\Tests\Core\Route\RouterRoleTest::testRoleAccess with data set #1 ('role_test_2', array(Drupal\user\Plugin\Core\Entity\User, Drupal\user\Plugin\Core\Entity\User))
-          Access granted for user with the roles role_test_2 on path: role_test_2
-          Failed asserting that false is true.
-        </failure>
-      </testcase>
-      <testcase name="testRoleAccess with data set #2" assertions="1" time="0.002303">
-        <failure type="PHPUnit_Framework_ExpectationFailedException">Drupal\Tests\Core\Route\RouterRoleTest::testRoleAccess with data set #2 ('role_test_3', array(Drupal\user\Plugin\Core\Entity\User))
-          Access granted for user with the roles role_test_1, role_test_2 on path: role_test_3
-          Failed asserting that false is true.
-        </failure>
-      </testcase>
+    <testsuite name="Drupal\Tests\Core\Route\RouterRoleTest" file="/var/www/d8/core/tests/Drupal/Tests/Core/Route/RouterRoleTest.php" namespace="Drupal\Tests\Core\Route" fullPackage="Drupal.Tests.Core.Route" tests="3" assertions="3" failures="3" errors="0" time="0.009176">
+      <testsuite name="Drupal\Tests\Core\Route\RouterRoleTest::testRoleAccess" tests="3" assertions="3" failures="3" errors="0" time="0.009176">
+        <testcase name="testRoleAccess with data set #0" assertions="1" time="0.004519">
+          <failure type="PHPUnit_Framework_ExpectationFailedException">Drupal\Tests\Core\Route\RouterRoleTest::testRoleAccess with data set #0 ('role_test_1', array(Drupal\user\Plugin\Core\Entity\User, Drupal\user\Plugin\Core\Entity\User))
+            Access granted for user with the roles role_test_1 on path: role_test_1
+            Failed asserting that false is true.
+          </failure>
+        </testcase>
+        <testcase name="testRoleAccess with data set #1" assertions="1" time="0.002354">
+          <failure type="PHPUnit_Framework_ExpectationFailedException">Drupal\Tests\Core\Route\RouterRoleTest::testRoleAccess with data set #1 ('role_test_2', array(Drupal\user\Plugin\Core\Entity\User, Drupal\user\Plugin\Core\Entity\User))
+            Access granted for user with the roles role_test_2 on path: role_test_2
+            Failed asserting that false is true.
+          </failure>
+        </testcase>
+        <testcase name="testRoleAccess with data set #2" assertions="1" time="0.002303">
+          <failure type="PHPUnit_Framework_ExpectationFailedException">Drupal\Tests\Core\Route\RouterRoleTest::testRoleAccess with data set #2 ('role_test_3', array(Drupal\user\Plugin\Core\Entity\User))
+            Access granted for user with the roles role_test_1, role_test_2 on path: role_test_3
+            Failed asserting that false is true.
+          </failure>
+        </testcase>
+      </testsuite>
     </testsuite>
   </testsuite>
 </testsuites>
