function CallbackTest::providerCallbackExceptions

Same name in other branches
  1. 8.9.x core/modules/migrate/tests/src/Unit/process/CallbackTest.php \Drupal\Tests\migrate\Unit\process\CallbackTest::providerCallbackExceptions()
  2. 10 core/modules/migrate/tests/src/Unit/process/CallbackTest.php \Drupal\Tests\migrate\Unit\process\CallbackTest::providerCallbackExceptions()
  3. 11.x core/modules/migrate/tests/src/Unit/process/CallbackTest.php \Drupal\Tests\migrate\Unit\process\CallbackTest::providerCallbackExceptions()

Data provider for ::testCallbackExceptions().

File

core/modules/migrate/tests/src/Unit/process/CallbackTest.php, line 101

Class

CallbackTest
Tests the callback process plugin.

Namespace

Drupal\Tests\migrate\Unit\process

Code

public function providerCallbackExceptions() {
    return [
        'not set' => [
            'message' => 'The "callable" must be set.',
            'configuration' => [],
        ],
        'invalid method' => [
            'message' => 'The "callable" must be a valid function or method.',
            'configuration' => [
                'callable' => 'nonexistent_callable',
            ],
        ],
        'array required' => [
            'message' => "When 'unpack_source' is set, the source must be an array. Instead it was of type 'string'",
            'configuration' => [
                'callable' => 'count',
                'unpack_source' => TRUE,
            ],
            'class' => MigrateException::class,
            'args' => 'This string is not an array.',
        ],
    ];
}

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