diff -u b/core/modules/migrate/src/MigrateExecutable.php b/core/modules/migrate/src/MigrateExecutable.php --- b/core/modules/migrate/src/MigrateExecutable.php +++ b/core/modules/migrate/src/MigrateExecutable.php @@ -19,6 +19,7 @@ * Defines a migrate executable class. */ class MigrateExecutable implements MigrateExecutableInterface { + use StringTranslationTrait; /** @@ -93,6 +94,8 @@ * (optional) The event dispatcher. * @param \Drupal\Migrate\MemoryManagerInterface $memory_manager * (optional) The memory manager. + * + * @throws \Drupal\migrate\MigrateException */ public function __construct(MigrationInterface $migration, MigrateMessageInterface $message = NULL, EventDispatcherInterface $event_dispatcher = NULL, MemoryManagerInterface $memory_manager = NULL) { $this->migration = $migration; @@ -454,10 +457,9 @@ * Checks for exceptional conditions, and display feedback. */ protected function checkStatus() { - if (!$this->getMemoryManager()->ensureMemory()) { - return MigrationInterface::RESULT_INCOMPLETE; - } - return MigrationInterface::RESULT_COMPLETED; + return $this->getMemoryManager()->ensureMemory() + ? MigrationInterface::RESULT_COMPLETED + : MigrationInterface::RESULT_INCOMPLETE; } } diff -u b/core/modules/migrate/tests/src/Unit/MigrateExecutableTest.php b/core/modules/migrate/tests/src/Unit/MigrateExecutableTest.php --- b/core/modules/migrate/tests/src/Unit/MigrateExecutableTest.php +++ b/core/modules/migrate/tests/src/Unit/MigrateExecutableTest.php @@ -495,17 +495,4 @@ /** - * Tests the checkStatus method. - */ - public function testCheckStatus() { - $this->memoryManager->expects($this->any()) - ->method('ensureMemory') - ->will($this->onConsecutiveCalls(TRUE, FALSE)); - $result = $this->executable->checkStatus(); - $this->assertEquals($result, MigrationInterface::RESULT_COMPLETED); - $result = $this->executable->checkStatus(); - $this->assertEquals($result, MigrationInterface::RESULT_INCOMPLETE); - } - - /** * Returns a mock migration source instance. * diff -u b/core/modules/migrate/tests/src/Unit/TestMigrateExecutable.php b/core/modules/migrate/tests/src/Unit/TestMigrateExecutable.php --- b/core/modules/migrate/tests/src/Unit/TestMigrateExecutable.php +++ b/core/modules/migrate/tests/src/Unit/TestMigrateExecutable.php @@ -53,22 +53,2 @@ - /** - * {@inheritdoc} - */ - protected function formatSize($size) { - return $size; - } - - /** - * {@inheritdoc} - */ - public function getMemoryManager() { - return parent::getMemoryManager(); - } - - /** - * {@inheritdoc} - */ - public function checkStatus() { - return parent::checkStatus(); - } }