You are here

public function NormalizerDenormalizeExceptionsUnitTestBase::providerNormalizerDenormalizeExceptions in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/hal/tests/src/Unit/NormalizerDenormalizeExceptionsUnitTestBase.php \Drupal\Tests\hal\Unit\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 25
Contains \Drupal\Tests\hal\Unit\NormalizerDenormalizeExceptionsUnitTestBase.

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
    ->getMock('\\Drupal\\Core\\Field\\Plugin\\DataType\\FieldItem', array(
    'getParent',
  ));
  $mock
    ->expects($this
    ->any())
    ->method('getParent')
    ->will($this
    ->returnValue(NULL));
  return array(
    array(
      array(),
    ),
    array(
      array(
        'target_instance' => $mock,
      ),
    ),
  );
}