update drupal
This commit is contained in:
@@ -200,7 +200,7 @@ class BlockContentTest extends ResourceTestBase {
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function testRelated() {
|
||||
$this->markTestSkipped('Remove this in https://www.drupal.org/project/jsonapi/issues/2940339');
|
||||
$this->markTestSkipped('Remove this in https://www.drupal.org/project/drupal/issues/2940339');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -392,7 +392,7 @@ class CommentTest extends ResourceTestBase {
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function testRelated() {
|
||||
$this->markTestSkipped('Remove this in https://www.drupal.org/project/jsonapi/issues/2940339');
|
||||
$this->markTestSkipped('Remove this in https://www.drupal.org/project/drupal/issues/2940339');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -117,10 +117,10 @@ class ConfigurableLanguageTest extends ResourceTestBase {
|
||||
/**
|
||||
* Test a GET request for a default config entity, which has a _core key.
|
||||
*
|
||||
* @see https://www.drupal.org/project/jsonapi/issues/2915539
|
||||
* @see https://www.drupal.org/project/drupal/issues/2915539
|
||||
*/
|
||||
public function testGetIndividualDefaultConfig() {
|
||||
// @todo Remove line below in favor of commented line in https://www.drupal.org/project/jsonapi/issues/2878463.
|
||||
// @todo Remove line below in favor of commented line in https://www.drupal.org/project/drupal/issues/2878463.
|
||||
$url = Url::fromRoute('jsonapi.configurable_language--configurable_language.individual', ['entity' => ConfigurableLanguage::load('en')->uuid()]);
|
||||
/* $url = ConfigurableLanguage::load('en')->toUrl('jsonapi'); */
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ class ExternalNormalizersTest extends BrowserTestBase {
|
||||
$this->assertSame(static::VALUE_ORIGINAL, $denormalized_entity->field_test->value);
|
||||
|
||||
// Asserts the expected JSON:API normalization.
|
||||
// @todo Remove line below in favor of commented line in https://www.drupal.org/project/jsonapi/issues/2878463.
|
||||
// @todo Remove line below in favor of commented line in https://www.drupal.org/project/drupal/issues/2878463.
|
||||
$url = Url::fromRoute('jsonapi.entity_test--entity_test.individual', ['entity' => $this->entity->uuid()]);
|
||||
// $url = $this->entity->toUrl('jsonapi');
|
||||
$client = $this->getSession()->getDriver()->getClient()->getClient();
|
||||
|
||||
@@ -51,7 +51,7 @@ class JsonApiRegressionTest extends JsonApiFunctionalTestBase {
|
||||
/**
|
||||
* Ensure filtering on relationships works with bundle-specific target types.
|
||||
*
|
||||
* @see https://www.drupal.org/project/jsonapi/issues/2953207
|
||||
* @see https://www.drupal.org/project/drupal/issues/2953207
|
||||
*/
|
||||
public function testBundleSpecificTargetEntityTypeFromIssue2953207() {
|
||||
// Set up data model.
|
||||
@@ -87,7 +87,7 @@ class JsonApiRegressionTest extends JsonApiFunctionalTestBase {
|
||||
/**
|
||||
* Ensure deep nested include works on multi target entity type field.
|
||||
*
|
||||
* @see https://www.drupal.org/project/jsonapi/issues/2973681
|
||||
* @see https://www.drupal.org/project/drupal/issues/2973681
|
||||
*/
|
||||
public function testDeepNestedIncludeMultiTargetEntityTypeFieldFromIssue2973681() {
|
||||
// Set up data model.
|
||||
@@ -151,7 +151,7 @@ class JsonApiRegressionTest extends JsonApiFunctionalTestBase {
|
||||
/**
|
||||
* Ensure POST and PATCH works for bundle-less relationship routes.
|
||||
*
|
||||
* @see https://www.drupal.org/project/jsonapi/issues/2976371
|
||||
* @see https://www.drupal.org/project/drupal/issues/2976371
|
||||
*/
|
||||
public function testBundlelessRelationshipMutationFromIssue2973681() {
|
||||
$this->config('jsonapi.settings')->set('read_only', FALSE)->save(TRUE);
|
||||
@@ -202,7 +202,7 @@ class JsonApiRegressionTest extends JsonApiFunctionalTestBase {
|
||||
/**
|
||||
* Ensures GETting terms works when multiple vocabularies exist.
|
||||
*
|
||||
* @see https://www.drupal.org/project/jsonapi/issues/2977879
|
||||
* @see https://www.drupal.org/project/drupal/issues/2977879
|
||||
*/
|
||||
public function testGetTermWhenMultipleVocabulariesExistFromIssue2977879() {
|
||||
// Set up data model.
|
||||
@@ -238,7 +238,7 @@ class JsonApiRegressionTest extends JsonApiFunctionalTestBase {
|
||||
/**
|
||||
* Cannot PATCH an entity with dangling references in an ER field.
|
||||
*
|
||||
* @see https://www.drupal.org/project/jsonapi/issues/2968972
|
||||
* @see https://www.drupal.org/project/drupal/issues/2968972
|
||||
*/
|
||||
public function testDanglingReferencesInAnEntityReferenceFieldFromIssue2968972() {
|
||||
$this->config('jsonapi.settings')->set('read_only', FALSE)->save(TRUE);
|
||||
@@ -309,7 +309,7 @@ class JsonApiRegressionTest extends JsonApiFunctionalTestBase {
|
||||
/**
|
||||
* Ensures GETting node collection + hook_node_grants() implementations works.
|
||||
*
|
||||
* @see https://www.drupal.org/project/jsonapi/issues/2984964
|
||||
* @see https://www.drupal.org/project/drupal/issues/2984964
|
||||
*/
|
||||
public function testGetNodeCollectionWithHookNodeGrantsImplementationsFromIssue2984964() {
|
||||
// Set up data model.
|
||||
@@ -340,7 +340,7 @@ class JsonApiRegressionTest extends JsonApiFunctionalTestBase {
|
||||
/**
|
||||
* Cannot GET an entity with dangling references in an ER field.
|
||||
*
|
||||
* @see https://www.drupal.org/project/jsonapi/issues/2984647
|
||||
* @see https://www.drupal.org/project/drupal/issues/2984647
|
||||
*/
|
||||
public function testDanglingReferencesInAnEntityReferenceFieldFromIssue2984647() {
|
||||
// Set up data model.
|
||||
@@ -470,7 +470,7 @@ class JsonApiRegressionTest extends JsonApiFunctionalTestBase {
|
||||
* Adding a new relationship field should cause new routes to be immediately
|
||||
* regenerated. The site builder should not need to manually rebuild caches.
|
||||
*
|
||||
* @see https://www.drupal.org/project/jsonapi/issues/2984886
|
||||
* @see https://www.drupal.org/project/drupal/issues/2984886
|
||||
*/
|
||||
public function testThatRoutesAreRebuiltAfterDataModelChangesFromIssue2984886() {
|
||||
$user = $this->drupalCreateUser(['access content']);
|
||||
@@ -526,7 +526,7 @@ class JsonApiRegressionTest extends JsonApiFunctionalTestBase {
|
||||
/**
|
||||
* Ensures denormalizing relationships with aliased field names works.
|
||||
*
|
||||
* @see https://www.drupal.org/project/jsonapi/issues/3007113
|
||||
* @see https://www.drupal.org/project/drupal/issues/3007113
|
||||
* @see https://www.drupal.org/project/jsonapi_extras/issues/3004582#comment-12817261
|
||||
*/
|
||||
public function testDenormalizeAliasedRelationshipFromIssue2953207() {
|
||||
@@ -584,7 +584,7 @@ class JsonApiRegressionTest extends JsonApiFunctionalTestBase {
|
||||
/**
|
||||
* Ensures that Drupal's page cache is effective.
|
||||
*
|
||||
* @see https://www.drupal.org/project/jsonapi/issues/3009596
|
||||
* @see https://www.drupal.org/project/drupal/issues/3009596
|
||||
*/
|
||||
public function testPageCacheFromIssue3009596() {
|
||||
$anonymous_role = Role::load(RoleInterface::ANONYMOUS_ID);
|
||||
@@ -619,7 +619,7 @@ class JsonApiRegressionTest extends JsonApiFunctionalTestBase {
|
||||
/**
|
||||
* Ensures that filtering by a sequential internal ID named 'id' is possible.
|
||||
*
|
||||
* @see https://www.drupal.org/project/jsonapi/issues/3015759
|
||||
* @see https://www.drupal.org/project/drupal/issues/3015759
|
||||
*/
|
||||
public function testFilterByIdFromIssue3015759() {
|
||||
// Set up data model.
|
||||
@@ -659,7 +659,7 @@ class JsonApiRegressionTest extends JsonApiFunctionalTestBase {
|
||||
/**
|
||||
* Ensures datetime fields are normalized using the correct timezone.
|
||||
*
|
||||
* @see https://www.drupal.org/project/jsonapi/issues/2999438
|
||||
* @see https://www.drupal.org/project/drupal/issues/2999438
|
||||
*/
|
||||
public function testPatchingDateTimeNormalizedWrongTimeZoneIssue3021194() {
|
||||
// Set up data model.
|
||||
@@ -708,7 +708,7 @@ class JsonApiRegressionTest extends JsonApiFunctionalTestBase {
|
||||
/**
|
||||
* Ensures PATCHing datetime (both date-only & date+time) fields is possible.
|
||||
*
|
||||
* @see https://www.drupal.org/project/jsonapi/issues/3021194
|
||||
* @see https://www.drupal.org/project/drupal/issues/3021194
|
||||
*/
|
||||
public function testPatchingDateTimeFieldsFromIssue3021194() {
|
||||
$this->config('jsonapi.settings')->set('read_only', FALSE)->save(TRUE);
|
||||
@@ -791,7 +791,7 @@ class JsonApiRegressionTest extends JsonApiFunctionalTestBase {
|
||||
/**
|
||||
* Ensure includes are respected even when POSTing.
|
||||
*
|
||||
* @see https://www.drupal.org/project/jsonapi/issues/3026030
|
||||
* @see https://www.drupal.org/project/drupal/issues/3026030
|
||||
*/
|
||||
public function testPostToIncludeUrlDoesNotReturnIncludeFromIssue3026030() {
|
||||
$this->config('jsonapi.settings')->set('read_only', FALSE)->save(TRUE);
|
||||
@@ -828,7 +828,7 @@ class JsonApiRegressionTest extends JsonApiFunctionalTestBase {
|
||||
/**
|
||||
* Ensure includes are respected even when PATCHing.
|
||||
*
|
||||
* @see https://www.drupal.org/project/jsonapi/issues/3026030
|
||||
* @see https://www.drupal.org/project/drupal/issues/3026030
|
||||
*/
|
||||
public function testPatchToIncludeUrlDoesNotReturnIncludeFromIssue3026030() {
|
||||
$this->config('jsonapi.settings')->set('read_only', FALSE)->save(TRUE);
|
||||
@@ -874,7 +874,7 @@ class JsonApiRegressionTest extends JsonApiFunctionalTestBase {
|
||||
/**
|
||||
* Ensure `@FieldType=map` fields are normalized correctly.
|
||||
*
|
||||
* @see https://www.drupal.org/project/jsonapi/issues/3040590
|
||||
* @see https://www.drupal.org/project/drupal/issues/3040590
|
||||
*/
|
||||
public function testMapFieldTypeNormalizationFromIssue3040590() {
|
||||
$this->assertTrue($this->container->get('module_installer')->install(['entity_test'], TRUE), 'Installed modules.');
|
||||
@@ -918,6 +918,62 @@ class JsonApiRegressionTest extends JsonApiFunctionalTestBase {
|
||||
$this->assertSame(['foo' => 'bar'], $data['data'][0]['attributes']['data']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure filtering for entities with empty entity reference fields works.
|
||||
*
|
||||
* @see https://www.drupal.org/project/drupal/issues/3025372
|
||||
*/
|
||||
public function testEmptyRelationshipFilteringFromIssue3025372() {
|
||||
// Set up data model.
|
||||
$this->drupalCreateContentType(['type' => 'folder']);
|
||||
$this->createEntityReferenceField(
|
||||
'node',
|
||||
'folder',
|
||||
'field_parent_folder',
|
||||
NULL,
|
||||
'node',
|
||||
'default',
|
||||
[
|
||||
'target_bundles' => ['folder'],
|
||||
],
|
||||
FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED
|
||||
);
|
||||
$this->rebuildAll();
|
||||
|
||||
// Create data.
|
||||
$node = Node::create([
|
||||
'title' => 'root folder',
|
||||
'type' => 'folder',
|
||||
]);
|
||||
$node->save();
|
||||
|
||||
// Test.
|
||||
$user = $this->drupalCreateUser(['access content']);
|
||||
$url = Url::fromRoute('jsonapi.node--folder.collection');
|
||||
$request_options = [
|
||||
RequestOptions::HEADERS => [
|
||||
'Content-Type' => 'application/vnd.api+json',
|
||||
'Accept' => 'application/vnd.api+json',
|
||||
],
|
||||
RequestOptions::AUTH => [$user->getAccountName(), $user->pass_raw],
|
||||
];
|
||||
$response = $this->request('GET', $url, $request_options);
|
||||
$this->assertSame(200, $response->getStatusCode(), (string) $response->getBody());
|
||||
$this->assertSame($node->uuid(), Json::decode((string) $response->getBody())['data'][0]['id']);
|
||||
$response = $this->request('GET', $url->setOption('query', [
|
||||
'filter[test][condition][path]' => 'field_parent_folder',
|
||||
'filter[test][condition][operator]' => 'IS NULL',
|
||||
]), $request_options);
|
||||
$this->assertSame(200, $response->getStatusCode(), (string) $response->getBody());
|
||||
$this->assertSame($node->uuid(), Json::decode((string) $response->getBody())['data'][0]['id']);
|
||||
$response = $this->request('GET', $url->setOption('query', [
|
||||
'filter[test][condition][path]' => 'field_parent_folder',
|
||||
'filter[test][condition][operator]' => 'IS NOT NULL',
|
||||
]), $request_options);
|
||||
$this->assertSame(200, $response->getStatusCode(), (string) $response->getBody());
|
||||
$this->assertEmpty(Json::decode((string) $response->getBody())['data']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests that the response still has meaningful error messages.
|
||||
*/
|
||||
@@ -1198,8 +1254,8 @@ class JsonApiRegressionTest extends JsonApiFunctionalTestBase {
|
||||
/**
|
||||
* Tests that "virtual/missing" resources can exist for renamed fields.
|
||||
*
|
||||
* @see https://www.drupal.org/project/jsonapi/issues/3034786
|
||||
* @see https://www.drupal.org/project/jsonapi_extras/issues/3035544
|
||||
* @see https://www.drupal.org/project/drupal/issues/3034786
|
||||
* @see https://www.drupal.org/project/drupal/issues/3035544
|
||||
*/
|
||||
public function testAliasedFieldsWithVirtualRelationships() {
|
||||
// Set up the data model.
|
||||
|
||||
@@ -348,7 +348,7 @@ class MediaTest extends ResourceTestBase {
|
||||
*/
|
||||
public function testPostIndividual() {
|
||||
// @todo Mimic \Drupal\Tests\rest\Functional\EntityResource\Media\MediaResourceTestBase::testPost()
|
||||
// @todo Later, use https://www.drupal.org/project/jsonapi/issues/2958554 to upload files rather than the REST module.
|
||||
// @todo Later, use https://www.drupal.org/project/drupal/issues/2958554 to upload files rather than the REST module.
|
||||
parent::testPostIndividual();
|
||||
}
|
||||
// @codingStandardsIgnoreEnd
|
||||
|
||||
@@ -176,7 +176,7 @@ class MenuLinkContentTest extends ResourceTestBase {
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function testRelated() {
|
||||
$this->markTestSkipped('Remove this in https://www.drupal.org/project/jsonapi/issues/2940339');
|
||||
$this->markTestSkipped('Remove this in https://www.drupal.org/project/drupal/issues/2940339');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -271,7 +271,7 @@ class NodeTest extends ResourceTestBase {
|
||||
$this->setUpAuthorization('PATCH');
|
||||
$this->config('jsonapi.settings')->set('read_only', FALSE)->save(TRUE);
|
||||
|
||||
// @todo Remove line below in favor of commented line in https://www.drupal.org/project/jsonapi/issues/2878463.
|
||||
// @todo Remove line below in favor of commented line in https://www.drupal.org/project/drupal/issues/2878463.
|
||||
$url = Url::fromRoute(sprintf('jsonapi.%s.individual', static::$resourceTypeName), ['entity' => $this->entity->uuid()]);
|
||||
// $url = $this->entity->toUrl('jsonapi');
|
||||
|
||||
@@ -311,14 +311,14 @@ class NodeTest extends ResourceTestBase {
|
||||
// Unpublish node.
|
||||
$this->entity->setUnpublished()->save();
|
||||
|
||||
// @todo Remove line below in favor of commented line in https://www.drupal.org/project/jsonapi/issues/2878463.
|
||||
// @todo Remove line below in favor of commented line in https://www.drupal.org/project/drupal/issues/2878463.
|
||||
$url = Url::fromRoute(sprintf('jsonapi.%s.individual', static::$resourceTypeName), ['entity' => $this->entity->uuid()]);
|
||||
// $url = $this->entity->toUrl('jsonapi');
|
||||
$request_options = $this->getAuthenticationRequestOptions();
|
||||
|
||||
// 403 when accessing own unpublished node.
|
||||
$response = $this->request('GET', $url, $request_options);
|
||||
// @todo Remove $expected + assertResourceResponse() in favor of the commented line below once https://www.drupal.org/project/jsonapi/issues/2943176 lands.
|
||||
// @todo Remove $expected + assertResourceResponse() in favor of the commented line below once https://www.drupal.org/project/drupal/issues/2943176 lands.
|
||||
$expected_document = [
|
||||
'jsonapi' => static::$jsonApiMember,
|
||||
'errors' => [
|
||||
@@ -374,7 +374,7 @@ class NodeTest extends ResourceTestBase {
|
||||
]);
|
||||
// After saving the entity the normalization should not be cached.
|
||||
$this->assertFalse($cache);
|
||||
// @todo Remove line below in favor of commented line in https://www.drupal.org/project/jsonapi/issues/2878463.
|
||||
// @todo Remove line below in favor of commented line in https://www.drupal.org/project/drupal/issues/2878463.
|
||||
$url = Url::fromRoute(sprintf('jsonapi.%s.individual', static::$resourceTypeName), ['entity' => $uuid]);
|
||||
// $url = $this->entity->toUrl('jsonapi');
|
||||
$request_options = $this->getAuthenticationRequestOptions();
|
||||
|
||||
@@ -906,7 +906,7 @@ abstract class ResourceTestBase extends BrowserTestBase {
|
||||
// - to first test all mistakes a developer might make, and assert that the
|
||||
// error responses provide a good DX
|
||||
// - to eventually result in a well-formed request that succeeds.
|
||||
// @todo Remove line below in favor of commented line in https://www.drupal.org/project/jsonapi/issues/2878463.
|
||||
// @todo Remove line below in favor of commented line in https://www.drupal.org/project/drupal/issues/2878463.
|
||||
$url = Url::fromRoute(sprintf('jsonapi.%s.individual', static::$resourceTypeName), ['entity' => $this->entity->uuid()]);
|
||||
// $url = $this->entity->toUrl('jsonapi');
|
||||
$request_options = [];
|
||||
@@ -975,9 +975,10 @@ abstract class ResourceTestBase extends BrowserTestBase {
|
||||
// contain a flattened response. Otherwise performance suffers.
|
||||
// @see \Drupal\jsonapi\EventSubscriber\ResourceResponseSubscriber::flattenResponse()
|
||||
$cache_items = $this->container->get('database')
|
||||
->query("SELECT cid, data FROM {cache_dynamic_page_cache} WHERE cid LIKE :pattern", [
|
||||
':pattern' => '%[route]=jsonapi.%',
|
||||
])
|
||||
->select('cache_dynamic_page_cache', 'cdp')
|
||||
->fields('cdp', ['cid', 'data'])
|
||||
->condition('cid', '%[route]=jsonapi.%', 'LIKE')
|
||||
->execute()
|
||||
->fetchAllAssoc('cid');
|
||||
$this->assertTrue(count($cache_items) >= 2);
|
||||
$found_cache_redirect = FALSE;
|
||||
@@ -1985,7 +1986,7 @@ abstract class ResourceTestBase extends BrowserTestBase {
|
||||
if (get_class($this->entityStorage) !== ContentEntityNullStorage::class) {
|
||||
$created_entity = $this->entityLoadUnchanged(static::$firstCreatedEntityId);
|
||||
$uuid = $created_entity->uuid();
|
||||
// @todo Remove line below in favor of commented line in https://www.drupal.org/project/jsonapi/issues/2878463.
|
||||
// @todo Remove line below in favor of commented line in https://www.drupal.org/project/drupal/issues/2878463.
|
||||
$location = Url::fromRoute(sprintf('jsonapi.%s.individual', static::$resourceTypeName), ['entity' => $uuid]);
|
||||
if (static::$resourceTypeIsVersionable) {
|
||||
assert($created_entity instanceof RevisionableInterface);
|
||||
@@ -2037,7 +2038,7 @@ abstract class ResourceTestBase extends BrowserTestBase {
|
||||
if ($this->entity->getEntityType()->getStorageClass() !== ContentEntityNullStorage::class && $this->entity->getEntityType()->hasKey('uuid')) {
|
||||
$second_created_entity = $this->entityStorage->load(static::$secondCreatedEntityId);
|
||||
$uuid = $second_created_entity->uuid();
|
||||
// @todo Remove line below in favor of commented line in https://www.drupal.org/project/jsonapi/issues/2878463.
|
||||
// @todo Remove line below in favor of commented line in https://www.drupal.org/project/drupal/issues/2878463.
|
||||
$location = Url::fromRoute(sprintf('jsonapi.%s.individual', static::$resourceTypeName), ['entity' => $uuid]);
|
||||
/* $location = $this->entityStorage->load(static::$secondCreatedEntityId)->toUrl('jsonapi')->setAbsolute(TRUE)->toString(); */
|
||||
if (static::$resourceTypeIsVersionable) {
|
||||
@@ -2117,7 +2118,7 @@ abstract class ResourceTestBase extends BrowserTestBase {
|
||||
// - to first test all mistakes a developer might make, and assert that the
|
||||
// error responses provide a good DX
|
||||
// - to eventually result in a well-formed request that succeeds.
|
||||
// @todo Remove line below in favor of commented line in https://www.drupal.org/project/jsonapi/issues/2878463.
|
||||
// @todo Remove line below in favor of commented line in https://www.drupal.org/project/drupal/issues/2878463.
|
||||
$url = Url::fromRoute(sprintf('jsonapi.%s.individual', static::$resourceTypeName), ['entity' => $this->entity->uuid()]);
|
||||
// $url = $this->entity->toUrl('jsonapi');
|
||||
$request_options = [];
|
||||
@@ -2370,7 +2371,7 @@ abstract class ResourceTestBase extends BrowserTestBase {
|
||||
$updated_entity->setNewRevision();
|
||||
$updated_entity->save();
|
||||
$actual_response = $this->request('PATCH', $url, $request_options);
|
||||
$this->assertResourceErrorResponse(400, 'Updating a resource object that has a working copy is not yet supported. See https://www.drupal.org/project/jsonapi/issues/2795279.', $url, $actual_response);
|
||||
$this->assertResourceErrorResponse(400, 'Updating a resource object that has a working copy is not yet supported. See https://www.drupal.org/project/drupal/issues/2795279.', $url, $actual_response);
|
||||
|
||||
// Allow PATCHing an unpublished default revision.
|
||||
$updated_entity->set('moderation_state', 'archived');
|
||||
@@ -2411,7 +2412,7 @@ abstract class ResourceTestBase extends BrowserTestBase {
|
||||
// - to first test all mistakes a developer might make, and assert that the
|
||||
// error responses provide a good DX
|
||||
// - to eventually result in a well-formed request that succeeds.
|
||||
// @todo Remove line below in favor of commented line in https://www.drupal.org/project/jsonapi/issues/2878463.
|
||||
// @todo Remove line below in favor of commented line in https://www.drupal.org/project/drupal/issues/2878463.
|
||||
$url = Url::fromRoute(sprintf('jsonapi.%s.individual', static::$resourceTypeName), ['entity' => $this->entity->uuid()]);
|
||||
// $url = $this->entity->toUrl('jsonapi');
|
||||
$request_options = [];
|
||||
@@ -2694,7 +2695,7 @@ abstract class ResourceTestBase extends BrowserTestBase {
|
||||
$request_options = NestedArray::mergeDeep($request_options, $this->getAuthenticationRequestOptions());
|
||||
$response = $this->request('GET', $url, $request_options);
|
||||
$detail = 'JSON:API does not yet support resource versioning for this resource type.';
|
||||
$detail .= ' For context, see https://www.drupal.org/project/jsonapi/issues/2992833#comment-12818258.';
|
||||
$detail .= ' For context, see https://www.drupal.org/project/drupal/issues/2992833#comment-12818258.';
|
||||
$detail .= ' To contribute, see https://www.drupal.org/project/drupal/issues/2350939 and https://www.drupal.org/project/drupal/issues/2809177.';
|
||||
$expected_cache_contexts = [
|
||||
'url.path',
|
||||
@@ -2731,7 +2732,7 @@ abstract class ResourceTestBase extends BrowserTestBase {
|
||||
$entity->save();
|
||||
$latest_revision_id = (int) $entity->getRevisionId();
|
||||
|
||||
// @todo Remove line below in favor of commented line in https://www.drupal.org/project/jsonapi/issues/2878463.
|
||||
// @todo Remove line below in favor of commented line in https://www.drupal.org/project/drupal/issues/2878463.
|
||||
$url = Url::fromRoute(sprintf('jsonapi.%s.individual', static::$resourceTypeName), ['entity' => $this->entity->uuid()])->setAbsolute();
|
||||
// $url = $this->entity->toUrl('jsonapi');
|
||||
$collection_url = Url::fromRoute(sprintf('jsonapi.%s.collection', static::$resourceTypeName))->setAbsolute();
|
||||
|
||||
@@ -372,7 +372,7 @@ class TermTest extends ResourceTestBase {
|
||||
$this->setUpAuthorization('PATCH');
|
||||
$this->config('jsonapi.settings')->set('read_only', FALSE)->save(TRUE);
|
||||
|
||||
// @todo Remove line below in favor of commented line in https://www.drupal.org/project/jsonapi/issues/2878463.
|
||||
// @todo Remove line below in favor of commented line in https://www.drupal.org/project/drupal/issues/2878463.
|
||||
$url = Url::fromRoute(sprintf('jsonapi.%s.individual', static::$resourceTypeName), ['entity' => $this->entity->uuid()]);
|
||||
// $url = $this->entity->toUrl('jsonapi');
|
||||
$request_options = [];
|
||||
@@ -438,7 +438,7 @@ class TermTest extends ResourceTestBase {
|
||||
// Modify the entity under test to use the provided parent terms.
|
||||
$this->entity->set('parent', $parent_term_ids)->save();
|
||||
|
||||
// @todo Remove line below in favor of commented line in https://www.drupal.org/project/jsonapi/issues/2878463.
|
||||
// @todo Remove line below in favor of commented line in https://www.drupal.org/project/drupal/issues/2878463.
|
||||
$url = Url::fromRoute(sprintf('jsonapi.%s.individual', static::$resourceTypeName), ['entity' => $this->entity->uuid()]);
|
||||
// $url = $this->entity->toUrl('jsonapi');
|
||||
$request_options = [];
|
||||
@@ -473,7 +473,7 @@ class TermTest extends ResourceTestBase {
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function testRelated() {
|
||||
$this->markTestSkipped('Remove this in https://www.drupal.org/project/jsonapi/issues/2940339');
|
||||
$this->markTestSkipped('Remove this in https://www.drupal.org/project/drupal/issues/2940339');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -8,7 +8,7 @@ use Drupal\FunctionalTests\Update\UpdatePathTestBase;
|
||||
* Tests that existing sites have the new read-only mode to "off".
|
||||
*
|
||||
* @see jsonapi_update_8701()
|
||||
* @see https://www.drupal.org/project/jsonapi/issues/3039568
|
||||
* @see https://www.drupal.org/project/drupal/issues/3039568
|
||||
*
|
||||
* @group jsonapi
|
||||
* @group Update
|
||||
|
||||
@@ -203,7 +203,7 @@ class UserTest extends ResourceTestBase {
|
||||
* Tests PATCHing security-sensitive base fields of the logged in account.
|
||||
*/
|
||||
public function testPatchDxForSecuritySensitiveBaseFields() {
|
||||
// @todo Remove line below in favor of commented line in https://www.drupal.org/project/jsonapi/issues/2878463.
|
||||
// @todo Remove line below in favor of commented line in https://www.drupal.org/project/drupal/issues/2878463.
|
||||
$url = Url::fromRoute(sprintf('jsonapi.user--user.individual'), ['entity' => $this->account->uuid()]);
|
||||
/* $url = $this->account->toUrl('jsonapi'); */
|
||||
|
||||
@@ -321,7 +321,7 @@ class UserTest extends ResourceTestBase {
|
||||
* Tests PATCHing security-sensitive base fields to change other users.
|
||||
*/
|
||||
public function testPatchSecurityOtherUser() {
|
||||
// @todo Remove line below in favor of commented line in https://www.drupal.org/project/jsonapi/issues/2878463.
|
||||
// @todo Remove line below in favor of commented line in https://www.drupal.org/project/drupal/issues/2878463.
|
||||
$url = Url::fromRoute(sprintf('jsonapi.user--user.individual'), ['entity' => $this->account->uuid()]);
|
||||
/* $url = $this->account->toUrl('jsonapi'); */
|
||||
|
||||
@@ -379,7 +379,7 @@ class UserTest extends ResourceTestBase {
|
||||
$this->grantPermissionsToTestedRole(['access user profiles']);
|
||||
|
||||
$collection_url = Url::fromRoute('jsonapi.user--user.collection', [], ['query' => ['sort' => 'drupal_internal__uid']]);
|
||||
// @todo Remove line below in favor of commented line in https://www.drupal.org/project/jsonapi/issues/2878463.
|
||||
// @todo Remove line below in favor of commented line in https://www.drupal.org/project/drupal/issues/2878463.
|
||||
$user_a_url = Url::fromRoute(sprintf('jsonapi.user--user.individual'), ['entity' => $user_a->uuid()]);
|
||||
/* $user_a_url = $user_a->toUrl('jsonapi'); */
|
||||
$request_options = [];
|
||||
|
||||
@@ -52,7 +52,7 @@ class WorkflowTest extends ResourceTestBase {
|
||||
protected function createEntity() {
|
||||
$workflow = Workflow::create([
|
||||
'id' => 'rest_workflow',
|
||||
'label' => 'REST Worklow',
|
||||
'label' => 'REST Workflow',
|
||||
'type' => 'workflow_type_complex_test',
|
||||
]);
|
||||
$workflow
|
||||
@@ -96,7 +96,7 @@ class WorkflowTest extends ResourceTestBase {
|
||||
'workflow_type_test',
|
||||
],
|
||||
],
|
||||
'label' => 'REST Worklow',
|
||||
'label' => 'REST Workflow',
|
||||
'langcode' => 'en',
|
||||
'status' => TRUE,
|
||||
'workflow_type' => 'workflow_type_complex_test',
|
||||
|
||||
+1
-1
@@ -302,7 +302,7 @@ class JsonApiDocumentTopLevelNormalizerTest extends JsonapiKernelTestBase {
|
||||
* @covers ::normalize
|
||||
*/
|
||||
public function testNormalizeRelated() {
|
||||
$this->markTestIncomplete('This fails and should be fixed by https://www.drupal.org/project/jsonapi/issues/2922121');
|
||||
$this->markTestIncomplete('This fails and should be fixed by https://www.drupal.org/project/drupal/issues/2922121');
|
||||
|
||||
list($request, $resource_type) = $this->generateProphecies('node', 'article', 'uid');
|
||||
$request->query = new ParameterBag([
|
||||
|
||||
@@ -67,10 +67,10 @@ class FilterTest extends JsonapiKernelTestBase {
|
||||
$this->savePaintings([
|
||||
['colors' => ['red'], 'shapes' => ['triangle'], 'title' => 'FIND'],
|
||||
['colors' => ['orange'], 'shapes' => ['circle'], 'title' => 'FIND'],
|
||||
['colors' => ['orange'], 'shapes' => ['triangle'], 'title' => 'DONT_FIND'],
|
||||
['colors' => ['orange'], 'shapes' => ['triangle'], 'title' => 'DO_NOT_FIND'],
|
||||
['colors' => ['yellow'], 'shapes' => ['square'], 'title' => 'FIND'],
|
||||
['colors' => ['yellow'], 'shapes' => ['triangle'], 'title' => 'DONT_FIND'],
|
||||
['colors' => ['orange'], 'shapes' => ['square'], 'title' => 'DONT_FIND'],
|
||||
['colors' => ['yellow'], 'shapes' => ['triangle'], 'title' => 'DO_NOT_FIND'],
|
||||
['colors' => ['orange'], 'shapes' => ['square'], 'title' => 'DO_NOT_FIND'],
|
||||
]);
|
||||
|
||||
$this->nodeStorage = $this->container->get('entity_type.manager')->getStorage('node');
|
||||
@@ -413,7 +413,7 @@ class FilterTest extends JsonapiKernelTestBase {
|
||||
*/
|
||||
protected function getFieldResolverMock(ResourceType $resource_type) {
|
||||
$field_resolver = $this->prophesize(FieldResolver::class);
|
||||
$field_resolver->resolveInternalEntityQueryPath($resource_type, Argument::any())->willReturnArgument(1);
|
||||
$field_resolver->resolveInternalEntityQueryPath($resource_type, Argument::any(), Argument::any())->willReturnArgument(1);
|
||||
return $field_resolver->reveal();
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -63,7 +63,7 @@ trait CommonCollectionFilterAccessTestPatternsTrait {
|
||||
|
||||
// Test.
|
||||
$collection_url = Url::fromRoute('jsonapi.entity_test--bar.collection');
|
||||
// Specifying a delta exercises TemporaryQueryGaurd more thoroughly.
|
||||
// Specifying a delta exercises TemporaryQueryGuard more thoroughly.
|
||||
$filter_path = "spotlight.0.$label_field_name";
|
||||
$collection_filter_url = $collection_url->setOption('query', ["filter[$filter_path]" => $this->entity->label()]);
|
||||
$request_options = [];
|
||||
|
||||
Reference in New Issue
Block a user