public function FieldResolverTest::resolveInternalIncludePathErrorProvider in JSON:API 8
Same name and namespace in other branches
- 8.2 tests/src/Kernel/Context/FieldResolverTest.php \Drupal\Tests\jsonapi\Kernel\Context\FieldResolverTest::resolveInternalIncludePathErrorProvider()
Provides test cases for ::testResolveInternalIncludePathError.
File
- tests/
src/ Kernel/ Context/ FieldResolverTest.php, line 124
Class
- FieldResolverTest
- @coversDefaultClass \Drupal\jsonapi\Context\FieldResolver @group jsonapi @group legacy
Namespace
Drupal\Tests\jsonapi\Kernel\ContextCode
public function resolveInternalIncludePathErrorProvider() {
return [
// Should fail because none of these bundles have these fields.
[
'entity_test_with_bundle',
'bundle1',
'host.fail!!.deep',
],
[
'entity_test_with_bundle',
'bundle2',
'field_test_ref2',
],
[
'entity_test_with_bundle',
'bundle1',
'field_test_ref3',
],
// Should fail because the nested fields don't exist on the targeted
// resource types.
[
'entity_test_with_bundle',
'bundle1',
'field_test_ref1.field_test1',
],
[
'entity_test_with_bundle',
'bundle1',
'field_test_ref1.field_test2',
],
[
'entity_test_with_bundle',
'bundle1',
'field_test_ref1.field_test_ref1',
],
[
'entity_test_with_bundle',
'bundle1',
'field_test_ref1.field_test_ref2',
],
// Should fail because the nested fields is not a valid relationship
// field name.
[
'entity_test_with_bundle',
'bundle1',
'field_test1',
'`field_test1` is not a valid relationship field name.',
],
// Should fail because the nested fields is not a valid include path.
[
'entity_test_with_bundle',
'bundle1',
'field_test_ref1.field_test3',
'`field_test_ref1.field_test3` is not a valid include path.',
],
];
}