diff --git a/config/install/replication.replication_settings.published.yml b/config/install/replication.replication_settings.published.yml index 87314bd..72555bf 100644 --- a/config/install/replication.replication_settings.published.yml +++ b/config/install/replication.replication_settings.published.yml @@ -5,4 +5,4 @@ id: published label: Replicate published entities filter_id: published parameters: - include_unpublishable_entities: FALSE + include_unpublishable_entities: false diff --git a/src/ReplicationTask/ReplicationTask.php b/src/ReplicationTask/ReplicationTask.php index 91ccc14..8ec4cd8 100644 --- a/src/ReplicationTask/ReplicationTask.php +++ b/src/ReplicationTask/ReplicationTask.php @@ -10,7 +10,7 @@ use Drupal\replication\ReplicationTask\ReplicationTaskInterface; class ReplicationTask implements ReplicationTaskInterface { /** - * The id of the filter plugin to use during replication. + * The ID of the filter plugin to use during replication. * * @var string */ @@ -56,7 +56,7 @@ class ReplicationTask implements ReplicationTaskInterface { if (!is_array($this->parameters)) { $this->setParameters([]); } - $this->parameters->set($name, $value); + $this->parameters[$name] = $value; return $this; } diff --git a/src/ReplicationTask/ReplicationTaskInterface.php b/src/ReplicationTask/ReplicationTaskInterface.php index 1c9b2e4..3280745 100644 --- a/src/ReplicationTask/ReplicationTaskInterface.php +++ b/src/ReplicationTask/ReplicationTaskInterface.php @@ -14,10 +14,10 @@ namespace Drupal\replication\ReplicationTask; interface ReplicationTaskInterface { /** - * Set the id of the filter plugin to use during replication. + * Set the ID of the filter plugin to use during replication. * * @param string $filter_name - * The plugin id of a ReplicationFilterInterface. + * The plugin ID of a ReplicationFilterInterface. * * @return ReplicationTaskInterface * Returns $this. @@ -25,17 +25,17 @@ interface ReplicationTaskInterface { public function setFilter($filter_name = NULL); /** - * Get the id of the filter plugin to use during replication. + * Get the ID of the filter plugin to use during replication. * * @return string - * The plugin id of a ReplicationFilterInterface. + * The plugin ID of a ReplicationFilterInterface. */ public function getFilter(); /** * Set the parameters for the filter plugin. * - * @param array|NULL $parameters_array + * @param array|NULL $parameters * An associative array of name-value parameters. * * @return ReplicationTaskInterface diff --git a/tests/src/Functional/ReplicationFilterTest.php b/tests/src/Functional/ReplicationFilterTest.php index ee13dad..57c6213 100644 --- a/tests/src/Functional/ReplicationFilterTest.php +++ b/tests/src/Functional/ReplicationFilterTest.php @@ -78,7 +78,7 @@ class ReplicationFilterTest extends WebTestBase { $parameters = ['uuids' => [$entity1->uuid()]]; $changes = $changes_factory->get($workspace)->filter('uuid')->parameters($parameters)->getNormal(); - $this->assertEqual(1, count($changes), 'Expect there is 1 entity in the changeset for UUIDs filter.'); + $this->assertCount(1, $changes, 'Expect there is 1 entity in the changeset for UUIDs filter.'); } /** @@ -110,7 +110,7 @@ class ReplicationFilterTest extends WebTestBase { $entity2->save(); $changes = $changes_factory->get($workspace)->filter('published')->getNormal(); - $this->assertEqual(1, count($changes), 'Expect there is 1 entity in the changeset for published filter.'); + $this->assertCount(1, $changes, 'Expect there is 1 entity in the changeset for published filter.'); } /** @@ -145,7 +145,7 @@ class ReplicationFilterTest extends WebTestBase { $parameters = ['types' => ['node.article']]; $changes = $changes_factory->get($workspace)->filter('entity_type')->parameters($parameters)->getNormal(); - $this->assertEqual(1, count($changes), 'Expect there is 1 entity in the changeset for entity type filter.'); + $this->assertCount(1, $changes, 'Expect there is 1 entity in the changeset for entity type filter.'); } } diff --git a/tests/src/Kernel/Plugin/ReplicationFilter/PublishedFilterTest.php b/tests/src/Kernel/Plugin/ReplicationFilter/PublishedFilterTest.php index 53e2e11..9e6baf5 100644 --- a/tests/src/Kernel/Plugin/ReplicationFilter/PublishedFilterTest.php +++ b/tests/src/Kernel/Plugin/ReplicationFilter/PublishedFilterTest.php @@ -60,7 +60,7 @@ class PublishedFilterTest extends KernelTestBase { * @param string $entity_type_id * The entity type id of the entity to create for testing. * @param array $entity_values - * The values to pass to $class::create(). + * The values with which to create the entity. * @param bool $expected * The expected return value from the filter function. * diff --git a/tests/src/Kernel/ReplicationSettingsTest.php b/tests/src/Kernel/ReplicationSettingsTest.php index cad3beb..b4c2632 100644 --- a/tests/src/Kernel/ReplicationSettingsTest.php +++ b/tests/src/Kernel/ReplicationSettingsTest.php @@ -3,7 +3,6 @@ namespace Drupal\Tests\replication\Kernel; use Drupal\KernelTests\KernelTestBase; -use Drupal\replication\Entity\ReplicationSettings; /** * Test operations on ReplicationSettings config entity. @@ -40,7 +39,6 @@ class ReplicationSettingsTest extends KernelTestBase { 'filter_id' => 'entity_type', 'parameters' => ['entity_type_id' => 'node', 'bundle' => 'article'], ]); - $this->assertInstanceOf(ReplicationSettings::class, $entity, 'Replication Settings entity was created.'); $entity->save(); $entity = $entityTypeManager->getStorage('replication_settings')->load('test');