.../tests/Traits/ContentModerationTestTrait.php | 91 ---------------------- src/JsonapiServiceProvider.php | 6 -- src/Routing/Routes.php | 5 -- tests/src/Functional/FileUploadTest.php | 3 - tests/src/Functional/ResourceTestBase.php | 2 +- 5 files changed, 1 insertion(+), 106 deletions(-) diff --git a/src/BackwardCompatibility/tests/Traits/ContentModerationTestTrait.php b/src/BackwardCompatibility/tests/Traits/ContentModerationTestTrait.php deleted file mode 100644 index 310bcfb..0000000 --- a/src/BackwardCompatibility/tests/Traits/ContentModerationTestTrait.php +++ /dev/null @@ -1,91 +0,0 @@ -=8.6 - */ -trait ContentModerationTestTrait { - - /** - * Creates the editorial workflow. - * - * @return \Drupal\workflows\Entity\Workflow - * The editorial workflow entity. - */ - protected function createEditorialWorkflow() { - $workflow = Workflow::create([ - 'type' => 'content_moderation', - 'id' => 'editorial', - 'label' => 'Editorial', - 'type_settings' => [ - 'states' => [ - 'archived' => [ - 'label' => 'Archived', - 'weight' => 5, - 'published' => FALSE, - 'default_revision' => TRUE, - ], - 'draft' => [ - 'label' => 'Draft', - 'published' => FALSE, - 'default_revision' => FALSE, - 'weight' => -5, - ], - 'published' => [ - 'label' => 'Published', - 'published' => TRUE, - 'default_revision' => TRUE, - 'weight' => 0, - ], - ], - 'transitions' => [ - 'archive' => [ - 'label' => 'Archive', - 'from' => ['published'], - 'to' => 'archived', - 'weight' => 2, - ], - 'archived_draft' => [ - 'label' => 'Restore to Draft', - 'from' => ['archived'], - 'to' => 'draft', - 'weight' => 3, - ], - 'archived_published' => [ - 'label' => 'Restore', - 'from' => ['archived'], - 'to' => 'published', - 'weight' => 4, - ], - 'create_new_draft' => [ - 'label' => 'Create New Draft', - 'to' => 'draft', - 'weight' => 0, - 'from' => [ - 'draft', - 'published', - ], - ], - 'publish' => [ - 'label' => 'Publish', - 'to' => 'published', - 'weight' => 1, - 'from' => [ - 'draft', - 'published', - ], - ], - ], - ], - ]); - $workflow->save(); - return $workflow; - } - -} diff --git a/src/JsonapiServiceProvider.php b/src/JsonapiServiceProvider.php index fe43787..4c6ba49 100644 --- a/src/JsonapiServiceProvider.php +++ b/src/JsonapiServiceProvider.php @@ -34,12 +34,6 @@ class JsonapiServiceProvider implements ServiceModifierInterface, ServiceProvide ['application/octet-stream'], ]); } - - // @todo Remove this when JSON:API requires Drupal >=8.6, see https://www.drupal.org/node/1927648. - if (floatval(\Drupal::VERSION) < 8.6) { - $container->removeDefinition('jsonapi.file_upload'); - $container->removeDefinition('file.uploader'); - } } /** diff --git a/src/Routing/Routes.php b/src/Routing/Routes.php index 3ccfd29..230d6de 100644 --- a/src/Routing/Routes.php +++ b/src/Routing/Routes.php @@ -205,11 +205,6 @@ class Routes implements ContainerInjectionInterface { * The route collection. */ protected static function getFileUploadRoutesForResourceType(ResourceType $resource_type, $path_prefix) { - // @todo Remove this when JSON:API requires Drupal >=8.6, see https://www.drupal.org/node/1927648. - if (\Drupal::VERSION < 8.6) { - return new RouteCollection(); - } - $routes = new RouteCollection(); // Internal resources have no routes; individual routes require locations. diff --git a/tests/src/Functional/FileUploadTest.php b/tests/src/Functional/FileUploadTest.php index 69e9a77..1c380aa 100644 --- a/tests/src/Functional/FileUploadTest.php +++ b/tests/src/Functional/FileUploadTest.php @@ -19,9 +19,6 @@ use Psr\Http\Message\ResponseInterface; * Tests binary data file upload route. * * @group jsonapi - * @requires function Drupal\file\Plugin\rest\resource\FileUploadResource::post - * - * @todo Remove the "@requires" annotation when JSON:API requires Drupal >=8.6 */ class FileUploadTest extends ResourceTestBase { diff --git a/tests/src/Functional/ResourceTestBase.php b/tests/src/Functional/ResourceTestBase.php index 27bd797..0ee43ad 100644 --- a/tests/src/Functional/ResourceTestBase.php +++ b/tests/src/Functional/ResourceTestBase.php @@ -26,7 +26,6 @@ use Drupal\Core\TypedData\TypedDataInternalPropertiesHelper; use Drupal\Core\Url; use Drupal\field\Entity\FieldConfig; use Drupal\field\Entity\FieldStorageConfig; -use Drupal\jsonapi\BackwardCompatibility\tests\Traits\ContentModerationTestTrait; use Drupal\jsonapi\JsonApiResource\LinkCollection; use Drupal\jsonapi\JsonApiResource\NullEntityCollection; use Drupal\jsonapi\JsonApiResource\Link; @@ -35,6 +34,7 @@ use Drupal\jsonapi\JsonApiResource\JsonApiDocumentTopLevel; use Drupal\jsonapi\ResourceResponse; use Drupal\path\Plugin\Field\FieldType\PathItem; use Drupal\Tests\BrowserTestBase; +use Drupal\Tests\content_moderation\Traits\ContentModerationTestTrait; use Drupal\user\Entity\Role; use Drupal\user\EntityOwnerInterface; use Drupal\user\RoleInterface;