Upgraded drupal core with security updates
[yaffs-website] / web / core / modules / hal / tests / src / Unit / NormalizerDenormalizeExceptionsUnitTestBase.php
1 <?php
2
3 namespace Drupal\Tests\hal\Unit;
4
5 use Drupal\Tests\UnitTestCase;
6
7 /**
8  * Common ancestor for FieldItemNormalizerDenormalizeExceptionsUnitTest and
9  * FieldNormalizerDenormalizeExceptionsUnitTest as they have the same
10  * dataProvider.
11  */
12 abstract class NormalizerDenormalizeExceptionsUnitTestBase extends UnitTestCase {
13
14   /**
15    * Provides data for FieldItemNormalizerDenormalizeExceptionsUnitTest::testFieldItemNormalizerDenormalizeExceptions()
16    * and for FieldNormalizerDenormalizeExceptionsUnitTest::testFieldNormalizerDenormalizeExceptions().
17    *
18    * @return array Test data.
19    */
20   public function providerNormalizerDenormalizeExceptions() {
21     $mock = $this->getMock('\Drupal\Core\Field\Plugin\DataType\FieldItem', ['getParent']);
22     $mock->expects($this->any())
23       ->method('getParent')
24       ->will($this->returnValue(NULL));
25     return [
26       [[]],
27       [['target_instance' => $mock]],
28     ];
29   }
30
31 }