function NormalizerDenormalizeExceptionsUnitTestBase::providerNormalizerDenormalizeExceptions

Provides data for FieldItemNormalizerDenormalizeExceptionsUnitTest::testFieldItemNormalizerDenormalizeExceptions() and for FieldNormalizerDenormalizeExceptionsUnitTest::testFieldNormalizerDenormalizeExceptions().

Return value

array Test data.

File

core/modules/hal/tests/src/Unit/NormalizerDenormalizeExceptionsUnitTestBase.php, line 20

Class

NormalizerDenormalizeExceptionsUnitTestBase
Common ancestor for FieldItemNormalizerDenormalizeExceptionsUnitTest and FieldNormalizerDenormalizeExceptionsUnitTest as they have the same dataProvider.

Namespace

Drupal\Tests\hal\Unit

Code

public function providerNormalizerDenormalizeExceptions() {
    $mock = $this->getMockBuilder('\\Drupal\\Core\\Field\\Plugin\\DataType\\FieldItem')
        ->setMethods([
        'getParent',
    ])
        ->getMock();
    $mock->expects($this->any())
        ->method('getParent')
        ->will($this->returnValue(NULL));
    return [
        [
            [],
        ],
        [
            [
                'target_instance' => $mock,
            ],
        ],
    ];
}

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