Fix type errors in tests
[MAILPOET-2688]
This commit is contained in:
@@ -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);
|
||||
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user