protected function MakeUniqueEntityFieldTest::entityQueryExpects in Drupal 8
Same name and namespace in other branches
- 9 core/modules/migrate/tests/src/Unit/process/MakeUniqueEntityFieldTest.php \Drupal\Tests\migrate\Unit\process\MakeUniqueEntityFieldTest::entityQueryExpects()
- 10 core/modules/migrate/tests/src/Unit/process/MakeUniqueEntityFieldTest.php \Drupal\Tests\migrate\Unit\process\MakeUniqueEntityFieldTest::entityQueryExpects()
Helper function to add expectations to the mock entity query object.
Parameters
int $count: The number of unique values to be set up.
1 call to MakeUniqueEntityFieldTest::entityQueryExpects()
- MakeUniqueEntityFieldTest::testMakeUniqueEntityField in core/
modules/ migrate/ tests/ src/ Unit/ process/ MakeUniqueEntityFieldTest.php - Tests making an entity field value unique.
File
- core/
modules/ migrate/ tests/ src/ Unit/ process/ MakeUniqueEntityFieldTest.php, line 159
Class
- MakeUniqueEntityFieldTest
- @coversDefaultClass \Drupal\migrate\Plugin\migrate\process\MakeUniqueEntityField @group migrate
Namespace
Drupal\Tests\migrate\Unit\processCode
protected function entityQueryExpects($count) {
$this->entityQuery
->expects($this
->exactly($count + 1))
->method('condition')
->will($this
->returnValue($this->entityQuery));
$this->entityQuery
->expects($this
->exactly($count + 1))
->method('count')
->will($this
->returnValue($this->entityQuery));
$this->entityQuery
->expects($this
->exactly($count + 1))
->method('execute')
->will($this
->returnCallback(function () use (&$count) {
return $count--;
}));
}