woocommerce-paypal-payments/tests/integration/PHPUnit/Traits/CleansTestData.php
2025-06-26 10:37:27 +02:00

25 lines
546 B
PHP

<?php
declare(strict_types=1);
namespace WooCommerce\PayPalCommerce\Tests\Integration\Traits;
trait CleansTestData
{
/**
* Clean all test data created by factories
*/
protected function cleanupTestData(): void
{
if (isset($this->order_factory)) {
$this->order_factory->cleanup();
}
if (isset($this->product_factory)) {
$this->product_factory->cleanup();
}
if (isset($this->coupon_factory)) {
$this->coupon_factory->cleanup();
}
}
}