You are here

public function QueryBatchTest::testBatchSizeNegative in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/migrate/tests/src/Kernel/QueryBatchTest.php \Drupal\Tests\migrate\Kernel\QueryBatchTest::testBatchSizeNegative()
  2. 9 core/modules/migrate/tests/src/Kernel/QueryBatchTest.php \Drupal\Tests\migrate\Kernel\QueryBatchTest::testBatchSizeNegative()

Tests a negative batch size throws an exception.

File

core/modules/migrate/tests/src/Kernel/QueryBatchTest.php, line 59

Class

QueryBatchTest
Tests query batching.

Namespace

Drupal\Tests\migrate\Kernel

Code

public function testBatchSizeNegative() {
  $this
    ->expectException(MigrateException::class);
  $this
    ->expectExceptionMessage('batch_size must be greater than or equal to zero');
  $plugin = $this
    ->getPlugin([
    'batch_size' => -1,
  ]);
  $plugin
    ->next();
}