Skip to content
Snippets Groups Projects
Commit 03cb2b91 authored by catch's avatar catch
Browse files

Issue #3432877 by thhomas, mstrelan: Remove deprecated actions from node module

parent b652bf94
No related branches found
No related tags found
No related merge requests found
<?php
namespace Drupal\node\Plugin\Action;
use Drupal\Core\Database\Connection;
use Drupal\action\Plugin\Action\AssignOwnerNode as ActionAssignOwnerNode;
/**
* Assigns ownership of a node to a user.
*
* @deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. Use
* \Drupal\action\Plugin\Action\AssignOwnerNode instead.
*
* @see https://www.drupal.org/node/3424506
*/
class AssignOwnerNode extends ActionAssignOwnerNode {
/**
* {@inheritdoc}
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, Connection $connection) {
@trigger_error(__CLASS__ . ' is deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. Use \Drupal\action\Plugin\Action\AssignOwnerNode instead. See https://www.drupal.org/node/3424506', E_USER_DEPRECATED);
parent::__construct($configuration, $plugin_id, $plugin_definition, $connection);
}
}
<?php
namespace Drupal\node\Plugin\Action;
use Drupal\action\Plugin\Action\UnpublishByKeywordNode as ActionUnpublishByKeywordNode;
/**
* Unpublishes a node containing certain keywords.
*
* @deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. Use
* \Drupal\action\Plugin\Action\UnpublishByKeywordNode instead.
*
* @see https://www.drupal.org/node/3424506
*/
class UnpublishByKeywordNode extends ActionUnpublishByKeywordNode {
/**
* {@inheritdoc}
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition) {
@trigger_error(__CLASS__ . ' is deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. Use \Drupal\action\Plugin\Action\UnpublishByKeywordNode instead. See https://www.drupal.org/node/3424506', E_USER_DEPRECATED);
parent::__construct($configuration, $plugin_id, $plugin_definition);
}
}
<?php
declare(strict_types=1);
namespace Drupal\Tests\node\Unit\Action;
use Drupal\Core\Database\Connection;
use Drupal\node\Plugin\Action\AssignOwnerNode;
use Drupal\Tests\UnitTestCase;
/**
* @group node
* @group legacy
*/
class AssignOwnerNodeTest extends UnitTestCase {
/**
* Tests deprecation of \Drupal\node\Plugin\Action\AssignOwnerNodeTest.
*/
public function testAssignOwnerNode() {
$this->expectDeprecation('Drupal\node\Plugin\Action\AssignOwnerNode is deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. Use \Drupal\action\Plugin\Action\AssignOwnerNode instead. See https://www.drupal.org/node/3424506');
$this->assertIsObject(new AssignOwnerNode([], 'foo', [], $this->prophesize(Connection::class)->reveal()));
}
}
<?php
declare(strict_types=1);
namespace Drupal\Tests\node\Unit\Action;
use Drupal\node\Plugin\Action\UnpublishByKeywordNode;
use Drupal\Tests\UnitTestCase;
/**
* @group node
* @group legacy
*/
class UnpublishByKeywordActionTest extends UnitTestCase {
/**
* Tests deprecation of \Drupal\node\Plugin\Action\UnpublishByKeywordNode.
*/
public function testUnpublishByKeywordAction() {
$this->expectDeprecation('Drupal\node\Plugin\Action\UnpublishByKeywordNode is deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. Use \Drupal\action\Plugin\Action\UnpublishByKeywordNode instead. See https://www.drupal.org/node/3424506');
$this->assertIsObject(new UnpublishByKeywordNode([], 'foo', []));
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment