protected function QueryStringWebformSourceEntityTest::getMockWebform in Webform 6.x
Same name and namespace in other branches
- 8.5 tests/src/Unit/Plugin/WebformSourceEntity/QueryStringWebformSourceEntityTest.php \Drupal\Tests\webform\Unit\Plugin\WebformSourceEntity\QueryStringWebformSourceEntityTest::getMockWebform()
Get mock webform entity.
Parameters
array $options: Mock webform options.
Return value
\PHPUnit\Framework\MockObject\MockObject A mocked webform entity.
1 call to QueryStringWebformSourceEntityTest::getMockWebform()
- QueryStringWebformSourceEntityTest::testGetCurrentSourceEntity in tests/
src/ Unit/ Plugin/ WebformSourceEntity/ QueryStringWebformSourceEntityTest.php - Tests detection of source entity via query string.
File
- tests/
src/ Unit/ Plugin/ WebformSourceEntity/ QueryStringWebformSourceEntityTest.php, line 163
Class
- QueryStringWebformSourceEntityTest
- Tests the "query_string" webform source entity plugin.
Namespace
Drupal\Tests\webform\Unit\Plugin\WebformSourceEntityCode
protected function getMockWebform(array $options) {
$webform = $this
->getMockBuilder(WebformInterface::class)
->disableOriginalConstructor()
->getMock();
$webform
->method('getSetting')
->willReturnMap([
[
'form_prepopulate_source_entity',
FALSE,
$options['webform_settings_prepopulate_source_entity'],
],
]);
$webform
->method('id')
->willReturn('webform_id');
return $webform;
}