function BatchBuilderTest::testSetFinishCallbackArray

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/Tests/Core/Batch/BatchBuilderTest.php \Drupal\Tests\Core\Batch\BatchBuilderTest::testSetFinishCallbackArray()

Tests setFinishCallback().

File

core/tests/Drupal/Tests/Core/Batch/BatchBuilderTest.php, line 96

Class

BatchBuilderTest
Tests for the batch builder class.

Namespace

Drupal\Tests\Core\Batch

Code

public function testSetFinishCallbackArray() : void {
  $batch = (new BatchBuilder())->setFinishCallback([
    static::class,
    'finishedCallback',
  ])
    ->toArray();
  $this->assertEquals([
    'Drupal\\Tests\\Core\\Batch\\BatchBuilderTest',
    'finishedCallback',
  ], $batch['finished']);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.