diff --git a/core/modules/simpletest/src/Tests/SimpleTestTest.php b/core/modules/simpletest/src/Tests/SimpleTestTest.php index 559ff53..b78e591 100644 --- a/core/modules/simpletest/src/Tests/SimpleTestTest.php +++ b/core/modules/simpletest/src/Tests/SimpleTestTest.php @@ -267,6 +267,19 @@ function confirmStubTestResults() { $this->assertEqual('16 passes, 3 fails, 2 exceptions, 4 debug messages', $this->childTestResults['summary']); + // Assert that there exists an assertion of type "Duration" and that the + // assertion message contains a numeric value (the duration in seconds). + $duration_assert_found = FALSE; + $duration_value_is_numeric = FALSE; + foreach ($this->childTestResults['assertions'] as $assertion) { + if ($assertion['type'] == 'Duration') { + $duration_assert_found = TRUE; + $duration_value_is_numeric = is_numeric($assertion['message']); + } + } + $this->assertTrue($duration_assert_found, 'Duration assert found.'); + $this->assertTrue($duration_value_is_numeric, 'Duration value is numeric.'); + $this->testIds[] = $test_id = $this->getTestIdFromResults(); $this->assertTrue($test_id, 'Found test ID in results.'); }