You are here

public function EntityResourceTest::removeFromRelationshipDataProvider in JSON:API 8.2

Provides data for the testDeleteRelationship.

Return value

array The input data for the test function.

File

tests/src/Kernel/Controller/EntityResourceTest.php, line 683

Class

EntityResourceTest
@coversDefaultClass \Drupal\jsonapi\Controller\EntityResource @group jsonapi @group legacy

Namespace

Drupal\Tests\jsonapi\Kernel\Controller

Code

public function removeFromRelationshipDataProvider() {
  return [
    // Remove one relationship.
    [
      [
        new ResourceIdentifier('node--article', static::$nodeUuid[1]),
      ],
      [
        [
          'target_id' => 2,
        ],
      ],
    ],
    // Remove all relationships.
    [
      [
        new ResourceIdentifier('node--article', static::$nodeUuid[2]),
        new ResourceIdentifier('node--article', static::$nodeUuid[1]),
      ],
      [],
    ],
    // Remove no relationship.
    [
      [],
      [
        [
          'target_id' => 1,
        ],
        [
          'target_id' => 2,
        ],
      ],
    ],
  ];
}