protected function TestDiscoveryTest::getTestDiscoveryMock in SimpleTest 8.3
Mock a TestDiscovery object to return specific extension values.
2 calls to TestDiscoveryTest::getTestDiscoveryMock()
- TestDiscoveryTest::testGetTestClasses in tests/
src/ Unit/ TestDiscoveryTest.php - @covers ::getTestClasses
- TestDiscoveryTest::testGetTestClassesWithSelectedTypes in tests/
src/ Unit/ TestDiscoveryTest.php - @covers ::getTestClasses
File
- tests/
src/ Unit/ TestDiscoveryTest.php, line 90
Class
- TestDiscoveryTest
- @coversDefaultClass \Drupal\simpletest\TestDiscovery
Namespace
Drupal\Tests\simpletest\UnitCode
protected function getTestDiscoveryMock($app_root, $extensions) {
$class_loader = $this
->prophesize(ClassLoader::class);
$module_handler = $this
->prophesize(ModuleHandlerInterface::class);
$test_discovery = $this
->getMockBuilder(TestDiscovery::class)
->setConstructorArgs([
$app_root,
$class_loader
->reveal(),
$module_handler
->reveal(),
])
->setMethods([
'getExtensions',
])
->getMock();
$test_discovery
->expects($this
->any())
->method('getExtensions')
->willReturn($extensions);
return $test_discovery;
}