From b837cabc0ea35331fdb2da49d69ccd084c4d99e3 Mon Sep 17 00:00:00 2001 From: Aaron Bauman <aaron@messageagency.com> Date: Fri, 15 Dec 2023 11:49:03 -0500 Subject: [PATCH] Fix queue handler test too --- .../tests/src/Unit/PullBaseTest.php | 18 ++++++++---------- .../tests/src/Unit/QueueHandlerTest.php | 16 ++++++---------- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/modules/salesforce_pull/tests/src/Unit/PullBaseTest.php b/modules/salesforce_pull/tests/src/Unit/PullBaseTest.php index d93cf363..f8f3e556 100644 --- a/modules/salesforce_pull/tests/src/Unit/PullBaseTest.php +++ b/modules/salesforce_pull/tests/src/Unit/PullBaseTest.php @@ -308,16 +308,14 @@ class PullBaseTest extends UnitTestCase { ->willReturn($this->entityDefinition); $this->etm = $prophecy->reveal(); - $this->pullWorker = $this->getMockBuilder(PullBase::CLASS) - ->setConstructorArgs([ - $this->etm, - $this->sfapi, - $this->ed, - [], - 'cron_salesforce_pull', - ['cron' => ['time' => 180]], - ]) - ->getMockForAbstractClass(); + $this->pullWorker = new CronPull( + $this->etm, + $this->sfapi, + $this->ed, + [], + 'cron_salesforce_pull', + ['cron' => ['time' => 180]], + ); $sobject = new SObject([ 'id' => $this->salesforce_id, diff --git a/modules/salesforce_pull/tests/src/Unit/QueueHandlerTest.php b/modules/salesforce_pull/tests/src/Unit/QueueHandlerTest.php index e83c65b7..0dd81a23 100644 --- a/modules/salesforce_pull/tests/src/Unit/QueueHandlerTest.php +++ b/modules/salesforce_pull/tests/src/Unit/QueueHandlerTest.php @@ -156,16 +156,14 @@ class QueueHandlerTest extends UnitTestCase { $this->time = $this->getMockBuilder(TimeInterface::CLASS)->getMock(); - $this->qh = $this->getMockBuilder(QueueHandler::CLASS) - ->setConstructorArgs([ + $this->qh = new QueueHandler( $this->sfapi, $this->etm, $this->queue_factory, $this->configFactory, $this->ed, - $this->time, - ]) - ->getMock(); + $this->time + ); } /** @@ -198,16 +196,14 @@ class QueueHandlerTest extends UnitTestCase { $prophecy->get(Argument::any())->willReturn($this->queue); $this->queue_factory = $prophecy->reveal(); - $this->qh = $this->getMockBuilder(QueueHandler::CLASS) - ->setConstructorArgs([ + $this->qh = new QueueHandler( $this->sfapi, $this->etm, $this->queue_factory, $this->configFactory, $this->ed, - $this->time, - ]) - ->getMock(); + $this->time + ); $result = $this->qh->getUpdatedRecords(); $this->assertFalse($result); } -- GitLab