You are here

public function NormalizerDenormalizeExceptionsUnitTestBase::providerNormalizerDenormalizeExceptions in Drupal 8

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,
      ],
    ],
  ];
}