function TestRunTest::testGetLogEntriesByTestClass
Same name and namespace in other branches
- 11.x core/tests/Drupal/KernelTests/Core/Test/TestRunTest.php \Drupal\KernelTests\Core\Test\TestRunTest::testGetLogEntriesByTestClass()
- 10 core/tests/Drupal/KernelTests/Core/Test/TestRunTest.php \Drupal\KernelTests\Core\Test\TestRunTest::testGetLogEntriesByTestClass()
Tests get log entries by test class.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Test/ TestRunTest.php, line 106
Class
Namespace
Drupal\KernelTests\Core\TestCode
public function testGetLogEntriesByTestClass() : void {
$test_run = TestRun::createNew($this->testRunResultsStorage);
$test_run->setDatabasePrefix('oddity1234');
$this->assertEquals(1, $test_run->insertLogEntry($this->getTestLogEntry('Test\\PlanetEarth')));
$this->assertEquals(2, $test_run->insertLogEntry($this->getTestLogEntry('Test\\GroundControl')));
$this->assertEquals([
0 => (object) [
'message_id' => '2',
'test_id' => '1',
'test_class' => 'Test\\GroundControl',
'status' => 'pass',
'message' => 'Major Tom',
'message_group' => 'other',
'function' => 'Unknown',
'line' => '0',
'file' => 'Unknown',
'time' => '0',
'exit_code' => '0',
],
1 => (object) [
'message_id' => '1',
'test_id' => '1',
'test_class' => 'Test\\PlanetEarth',
'status' => 'pass',
'message' => 'Major Tom',
'message_group' => 'other',
'function' => 'Unknown',
'line' => '0',
'file' => 'Unknown',
'time' => '0',
'exit_code' => '0',
],
], $test_run->getLogEntriesByTestClass());
$this->assertEquals('oddity1234', $test_run->getDatabasePrefix());
$this->assertEquals('Test\\GroundControl', $test_run->getTestClass());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.