Fix type errors in tests

[MAILPOET-2688]
This commit is contained in:
Jan Jakes
2022-11-18 11:44:20 +01:00
committed by Aschepikov
parent d66fbb1c20
commit 723dc2c9d3
4 changed files with 7 additions and 7 deletions

View File

@@ -45,7 +45,7 @@ class StatisticsWooCommercePurchases {
$this->click,
$this->data['order_id'],
$this->data['order_currency'],
$this->data['order_price_total']
(float)$this->data['order_price_total']
);
$entity->setSubscriber($this->subscriber);

View File

@@ -34,7 +34,7 @@ class DaemonHttpRunnerTest extends \MailPoetTest {
[]
);
$daemon = $this->diContainer->get(DaemonHttpRunner::class);
expect(strlen($daemon->timer))->greaterOrEquals(5);
expect(strlen((string)$daemon->timer))->greaterOrEquals(5);
expect(strlen($daemon->token))->greaterOrEquals(5);
}

View File

@@ -158,7 +158,7 @@ class SendingQueueTest extends \MailPoetTest {
}
private function getDirectUnsubscribeURL() {
return SubscriptionUrlFactory::getInstance()->getUnsubscribeUrl($this->subscriber, $this->queue->id);
return SubscriptionUrlFactory::getInstance()->getUnsubscribeUrl($this->subscriber, (int)$this->queue->id);
}
private function getTrackedUnsubscribeURL() {
@@ -494,7 +494,7 @@ class SendingQueueTest extends \MailPoetTest {
$subscriberId = (int)$subscriberId[0];
$subscriber = $subscribersRepository->findOneById($subscriberId);
$subscriptionUrlFactory = SubscriptionUrlFactory::getInstance();
$unsubscribeUrl = $subscriptionUrlFactory->getUnsubscribeUrl($subscriber, $queue->id);
$unsubscribeUrl = $subscriptionUrlFactory->getUnsubscribeUrl($subscriber, (int)$queue->id);
expect($newsletter['subject'])->equals('News for ' . $subscriberEmail);
expect($newsletter['body']['html'])->equals('<p>Hello ' . $subscriberEmail . '</p>');
expect($newsletter['body']['text'])->equals('Hello ' . $subscriberEmail);

View File

@@ -57,7 +57,7 @@ class UnsubscribesTest extends \MailPoetTest {
$this->unsubscribes->track(
$subscriberId,
'source',
$this->queue->id,
(int)$this->queue->id,
null,
StatisticsUnsubscribeEntity::METHOD_ONE_CLICK
);
@@ -69,12 +69,12 @@ class UnsubscribesTest extends \MailPoetTest {
public function testItDoesNotTrackRepeatedUnsubscribeEvents() {
$subscriberId = $this->subscriber->getId();
$this->assertIsInt($subscriberId);
for ($count = 0; $count <= 2; $count++) {
$this->unsubscribes->track(
$subscriberId,
'source',
$this->queue->id
(int)$this->queue->id
);
}
expect(count($this->statisticsUnsubscribesRepository->findAll()))->equals(1);