protected function MigrateExecutableTest::getMockSource in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/migrate/tests/src/Unit/MigrateExecutableTest.php \Drupal\Tests\migrate\Unit\MigrateExecutableTest::getMockSource()
Returns a mock migration source instance.
Return value
\Drupal\migrate\Plugin\MigrateSourceInterface|\PHPUnit_Framework_MockObject_MockObject
6 calls to MigrateExecutableTest::getMockSource()
- MigrateExecutableTest::testImportWithValidRow in core/
modules/ migrate/ tests/ src/ Unit/ MigrateExecutableTest.php - Tests the import method with a valid row.
- MigrateExecutableTest::testImportWithValidRowNoDestinationValues in core/
modules/ migrate/ tests/ src/ Unit/ MigrateExecutableTest.php - Tests the import method with a valid row.
- MigrateExecutableTest::testImportWithValidRowWithDestinationMigrateException in core/
modules/ migrate/ tests/ src/ Unit/ MigrateExecutableTest.php - Tests the import method with a MigrateException being thrown from the destination.
- MigrateExecutableTest::testImportWithValidRowWithException in core/
modules/ migrate/ tests/ src/ Unit/ MigrateExecutableTest.php - Tests the import method with a regular Exception being thrown.
- MigrateExecutableTest::testImportWithValidRowWithoutDestinationId in core/
modules/ migrate/ tests/ src/ Unit/ MigrateExecutableTest.php - Tests the import method with a valid row.
File
- core/
modules/ migrate/ tests/ src/ Unit/ MigrateExecutableTest.php, line 425 - Contains \Drupal\Tests\migrate\Unit\MigrateExecutableTest.
Class
- MigrateExecutableTest
- @coversDefaultClass \Drupal\Tests\migrate\Unit\MigrateExecutableTest @group migrate
Namespace
Drupal\Tests\migrate\UnitCode
protected function getMockSource() {
$iterator = $this
->getMock('\\Iterator');
$class = 'Drupal\\migrate\\Plugin\\migrate\\source\\SourcePluginBase';
$source = $this
->getMockBuilder($class)
->disableOriginalConstructor()
->setMethods(get_class_methods($class))
->getMockForAbstractClass();
$source
->expects($this
->once())
->method('rewind')
->will($this
->returnValue(TRUE));
$source
->expects($this
->any())
->method('initializeIterator')
->will($this
->returnValue([]));
$source
->expects($this
->any())
->method('valid')
->will($this
->onConsecutiveCalls(TRUE, FALSE));
return $source;
}