Files
piratepoet/mailpoet/tests/unit/WPCOM/DotcomHelperFunctionsTest.php
Pavel Dohnal 7143d7afb2 Add tracking of WooCommerce performance plan
[MAILPOET-5628]
2023-10-09 13:00:43 +02:00

34 lines
1.0 KiB
PHP

<?php declare(strict_types = 1);
namespace MailPoet\WPCOM;
class DotcomHelperFunctionsTest extends \MailPoetUnitTest {
/*** @var DotcomHelperFunctions */
private $dotcomHelper;
public function _before() {
parent::_before();
$this->dotcomHelper = new DotcomHelperFunctions();
}
public function testItReturnsFalseIfNotDotcom() {
expect($this->dotcomHelper->isDotcom())->false();
}
public function testItReturnsTrueIfDotcom() {
define('IS_ATOMIC', true);
define('ATOMIC_CLIENT_ID', '2');
expect($this->dotcomHelper->isDotcom())->true();
}
public function testItReturnsEmptyStringIfNoPlan() {
expect($this->dotcomHelper->getDotcomPlan())->equals('');
}
public function testItReturnsPerformanceIfWooExpressPerformance() {
$dotcomHelper = $this->createPartialMock(DotcomHelperFunctions::class, ['isWooExpressPerformance']);
$dotcomHelper->method('isWooExpressPerformance')->willReturn(true);
expect($dotcomHelper->getDotcomPlan())->equals('performance');
}
}