Remove redundant tests

MAILPOET-5083
This commit is contained in:
John Oleksowicz
2023-04-10 11:18:16 -05:00
committed by Aschepikov
parent 4576dd289f
commit f3f7d4dc61
2 changed files with 0 additions and 84 deletions

View File

@ -70,47 +70,6 @@ class WooCommerceNumberOfOrdersTest extends \MailPoetTest {
$this->assertEqualsCanonicalizing([$createdSub->getEmail()], $emails);
}
/**
* @dataProvider allowedStatuses
*/
public function testItIncludesAllowedStatuses($status) {
$email = "$status@example.com";
$customerId = $this->tester->createCustomer($email, 'customer');
$this->createOrder($customerId, Carbon::now(), $status);
$segmentFilterData = $this->getSegmentFilterData('=', 1, 1);
$emails = $this->tester->getSubscriberEmailsMatchingDynamicFilter($segmentFilterData, $this->numberOfOrdersFilter);
expect($emails)->contains($email);
}
/**
* @dataProvider disallowedStatuses
*/
public function testItExcludesDisallowedOrderStatuses($status) {
$email = "$status@example.com";
$customerId = $this->tester->createCustomer($email, 'customer');
$this->createOrder($customerId, Carbon::now(), $status);
$segmentFilterData = $this->getSegmentFilterData('=', 1, 1);
$emails = $this->tester->getSubscriberEmailsMatchingDynamicFilter($segmentFilterData, $this->numberOfOrdersFilter);
expect($emails)->notContains($email);
}
public function allowedStatuses() {
return [
'completed' => ['wc-completed'],
'processing' => ['wc-processing'],
];
}
public function disallowedStatuses() {
return [
'refunded' => ['wc-refunded'],
'cancelled' => ['wc-cancelled'],
'on hold' => ['wc-on-hold'],
'pending' => ['wc-pending'],
'failed' => ['wc-failed'],
];
}
private function getSegmentFilterData(string $comparisonType, int $ordersCount, int $days): DynamicSegmentFilterData {
return new DynamicSegmentFilterData(DynamicSegmentFilterData::TYPE_WOOCOMMERCE, WooCommerceNumberOfOrders::ACTION_NUMBER_OF_ORDERS, [
'number_of_orders_type' => $comparisonType,

View File

@ -81,49 +81,6 @@ class WooCommerceProductTest extends \MailPoetTest {
$this->assertEqualsCanonicalizing($expectedEmails, $emails);
}
/**
* @dataProvider allowedStatuses
*/
public function testItIncludesAllowedStatuses($status) {
$email = "status-customer@example.com";
$customerId = $this->tester->createCustomer($email, 'customer');
$orderId = $this->createOrder($customerId, Carbon::now(), $status);
$this->addToOrder(5, $orderId, $this->productIds[0], $customerId);
$segmentFilterData = $this->getSegmentFilterData($this->productIds, DynamicSegmentFilterData::OPERATOR_ANY);
$emails = $this->tester->getSubscriberEmailsMatchingDynamicFilter($segmentFilterData, $this->wooCommerceProductFilter);
expect($emails)->contains($email);
}
/**
* @dataProvider disallowedStatuses
*/
public function testItExcludesDisallowedOrderStatuses($status) {
$email = "status-customer@example.com";
$customerId = $this->tester->createCustomer($email, 'customer');
$orderId = $this->createOrder($customerId, Carbon::now(), $status);
$this->addToOrder(5, $orderId, $this->productIds[0], $customerId);
$segmentFilterData = $this->getSegmentFilterData($this->productIds, DynamicSegmentFilterData::OPERATOR_ANY);
$emails = $this->tester->getSubscriberEmailsMatchingDynamicFilter($segmentFilterData, $this->wooCommerceProductFilter);
expect($emails)->notContains($email);
}
public function allowedStatuses() {
return [
'completed' => ['wc-completed'],
'processing' => ['wc-processing'],
];
}
public function disallowedStatuses() {
return [
'refunded' => ['wc-refunded'],
'cancelled' => ['wc-cancelled'],
'on hold' => ['wc-on-hold'],
'pending' => ['wc-pending'],
'failed' => ['wc-failed'],
];
}
private function getSegmentFilterData(array $productIds, string $operator): DynamicSegmentFilterData {
$filterData = [
'product_ids' => $productIds,