class SimpletestPhpunitRunCommandTest in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/simpletest/tests/src/Unit/SimpletestPhpunitRunCommandTest.php \Drupal\Tests\simpletest\Unit\SimpletestPhpunitRunCommandTest
Tests simpletest_run_phpunit_tests() handles PHPunit fatals correctly.
@group simpletest
@runTestsInSeparateProcesses @preserveGlobalState disabled
Hierarchy
- class \Drupal\Tests\UnitTestCase extends \Drupal\Tests\PHPUnit_Framework_TestCase
- class \Drupal\Tests\simpletest\Unit\SimpletestPhpunitRunCommandTest
Expanded class hierarchy of SimpletestPhpunitRunCommandTest
File
- core/
modules/ simpletest/ tests/ src/ Unit/ SimpletestPhpunitRunCommandTest.php, line 21 - Contains \Drupal\Tests\simpletest\Unit\SimpletestPhpunitRunCommandTest.
Namespace
Drupal\Tests\simpletest\UnitView source
class SimpletestPhpunitRunCommandTest extends UnitTestCase {
function testSimpletestPhpUnitRunCommand() {
include_once __DIR__ . '/../../fixtures/simpletest_phpunit_run_command_test.php';
$app_root = __DIR__ . '/../../../../../..';
include_once "{$app_root}/core/modules/simpletest/simpletest.module";
$container = new ContainerBuilder();
$container
->set('app.root', $app_root);
$file_system = $this
->prophesize('Drupal\\Core\\File\\FileSystemInterface');
$file_system
->realpath('public://simpletest')
->willReturn(sys_get_temp_dir());
$container
->set('file_system', $file_system
->reveal());
\Drupal::setContainer($container);
$test_id = basename(tempnam(sys_get_temp_dir(), 'xxx'));
foreach ([
'pass',
'fail',
] as $status) {
putenv('SimpletestPhpunitRunCommandTestWillDie=' . $status);
$ret = simpletest_run_phpunit_tests($test_id, [
'Drupal\\Tests\\simpletest\\Unit\\SimpletestPhpunitRunCommandTestWillDie',
]);
$this
->assertSame($ret[0]['status'], $status);
}
unlink(simpletest_phpunit_xml_filepath($test_id));
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SimpletestPhpunitRunCommandTest:: |
function | |||
UnitTestCase:: |
protected | property | The random generator. | |
UnitTestCase:: |
protected | property | The app root. | |
UnitTestCase:: |
protected | function | Asserts if two arrays are equal by sorting them first. | |
UnitTestCase:: |
protected | function | Mocks a block with a block plugin. | |
UnitTestCase:: |
protected | function | Returns a stub class resolver. | |
UnitTestCase:: |
public | function | Returns a stub config factory that behaves according to the passed in array. | |
UnitTestCase:: |
public | function | Returns a stub config storage that returns the supplied configuration. | |
UnitTestCase:: |
protected | function | Sets up a container with a cache tags invalidator. | |
UnitTestCase:: |
protected | function | Gets the random generator for the utility methods. | |
UnitTestCase:: |
public | function | Returns a stub translation manager that just returns the passed string. | |
UnitTestCase:: |
public | function | Generates a unique random string containing letters and numbers. | |
UnitTestCase:: |
protected | function | 259 |