class TestMigrateExecutable in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/migrate/tests/src/Unit/TestMigrateExecutable.php \Drupal\Tests\migrate\Unit\TestMigrateExecutable
Tests MigrateExecutable.
Hierarchy
- class \Drupal\migrate\MigrateExecutable implements MigrateExecutableInterface uses StringTranslationTrait
- class \Drupal\Tests\migrate\Unit\TestMigrateExecutable
Expanded class hierarchy of TestMigrateExecutable
File
- core/
modules/ migrate/ tests/ src/ Unit/ TestMigrateExecutable.php, line 16 - Contains \Drupal\Tests\migrate\Unit\TestMigrateExecutable.
Namespace
Drupal\Tests\migrate\UnitView source
class TestMigrateExecutable extends MigrateExecutable {
/**
* The fake memory usage in bytes.
*
* @var int
*/
protected $memoryUsage;
/**
* The cleared memory usage.
*
* @var int
*/
protected $clearedMemoryUsage;
/**
* Sets the string translation service.
*
* @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation
* The translation manager.
*/
public function setStringTranslation(TranslationInterface $string_translation) {
$this->stringTranslation = $string_translation;
}
/**
* Allows access to set protected source property.
*
* @param \Drupal\migrate\Plugin\MigrateSourceInterface $source
* The value to set.
*/
public function setSource($source) {
$this->source = $source;
}
/**
* Allows access to protected sourceIdValues property.
*
* @param array $source_id_values
* The value to set.
*/
public function setSourceIdValues($source_id_values) {
$this->sourceIdValues = $source_id_values;
}
/**
* {@inheritdoc}
*/
public function handleException(\Exception $exception, $save = TRUE) {
$message = $exception
->getMessage();
if ($save) {
$this
->saveMessage($message);
}
$this->message
->display($message);
}
/**
* Allows access to the protected memoryExceeded method.
*
* @return bool
* The memoryExceeded value.
*/
public function memoryExceeded() {
return parent::memoryExceeded();
}
/**
* {@inheritdoc}
*/
protected function attemptMemoryReclaim() {
return $this->clearedMemoryUsage;
}
/**
* {@inheritdoc}
*/
protected function getMemoryUsage() {
return $this->memoryUsage;
}
/**
* Sets the fake memory usage.
*
* @param int $memory_usage
* The fake memory usage value.
* @param int $cleared_memory_usage
* (optional) The fake cleared memory value.
*/
public function setMemoryUsage($memory_usage, $cleared_memory_usage = NULL) {
$this->memoryUsage = $memory_usage;
$this->clearedMemoryUsage = $cleared_memory_usage;
}
/**
* Sets the memory limit.
*
* @param int $memory_limit
* The memory limit.
*/
public function setMemoryLimit($memory_limit) {
$this->memoryLimit = $memory_limit;
}
/**
* Sets the memory threshold.
*
* @param float $threshold
* The new threshold.
*/
public function setMemoryThreshold($threshold) {
$this->memoryThreshold = $threshold;
}
/**
* {@inheritdoc}
*/
protected function formatSize($size) {
return $size;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MigrateExecutable:: |
protected | property | An array of counts. Initially used for cache hit/miss tracking. | |
MigrateExecutable:: |
protected | property | The object currently being constructed. | |
MigrateExecutable:: |
protected | property | The event dispatcher. | |
MigrateExecutable:: |
protected | property | The PHP memory_limit expressed in bytes. | |
MigrateExecutable:: |
protected | property | The ratio of the memory limit at which an operation will be interrupted. | |
MigrateExecutable:: |
protected | property | The configuration of the migration to do. | |
MigrateExecutable:: |
protected | property | The source. | |
MigrateExecutable:: |
protected | property | The configuration values of the source. | |
MigrateExecutable:: |
protected | property | Status of one row. | |
MigrateExecutable:: |
protected | property | The current data row retrieved from the source. | |
MigrateExecutable:: |
protected | function | Checks for exceptional conditions, and display feedback. | |
MigrateExecutable:: |
protected | function | Fetches the key array for the current source record. | |
MigrateExecutable:: |
protected | function | Gets the event dispatcher. | |
MigrateExecutable:: |
protected | function | Returns the source. | |
MigrateExecutable:: |
public | function |
Performs an import operation - migrate items from source to destination. Overrides MigrateExecutableInterface:: |
|
MigrateExecutable:: |
public | function |
Processes a row. Overrides MigrateExecutableInterface:: |
|
MigrateExecutable:: |
public | function |
Performs a rollback operation - remove previously-imported items. Overrides MigrateExecutableInterface:: |
|
MigrateExecutable:: |
public | function |
Passes messages through to the map class. Overrides MigrateExecutableInterface:: |
|
MigrateExecutable:: |
public | function | Constructs a MigrateExecutable and verifies and sets the memory limit. | |
StringTranslationTrait:: |
protected | property | The string translation service. | |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. | |
TestMigrateExecutable:: |
protected | property | The cleared memory usage. | |
TestMigrateExecutable:: |
protected | property | The fake memory usage in bytes. | |
TestMigrateExecutable:: |
protected | function |
Tries to reclaim memory. Overrides MigrateExecutable:: |
|
TestMigrateExecutable:: |
protected | function |
Generates a string representation for the given byte count. Overrides MigrateExecutable:: |
|
TestMigrateExecutable:: |
protected | function |
Returns the memory usage so far. Overrides MigrateExecutable:: |
|
TestMigrateExecutable:: |
public | function |
Takes an Exception object and both saves and displays it. Overrides MigrateExecutable:: |
|
TestMigrateExecutable:: |
public | function |
Allows access to the protected memoryExceeded method. Overrides MigrateExecutable:: |
|
TestMigrateExecutable:: |
public | function | Sets the memory limit. | |
TestMigrateExecutable:: |
public | function | Sets the memory threshold. | |
TestMigrateExecutable:: |
public | function | Sets the fake memory usage. | |
TestMigrateExecutable:: |
public | function | Allows access to set protected source property. | |
TestMigrateExecutable:: |
public | function | Allows access to protected sourceIdValues property. | |
TestMigrateExecutable:: |
public | function |
Sets the string translation service. Overrides StringTranslationTrait:: |