# packeta/2.0.9/tests/Module/Shipping/ShippingProviderTest.php

Packeta, version 2.0.9. 52 lines.

- Page: https://pluginprobe.com/plugins/packeta/2.0.9/code/tests/Module/Shipping/ShippingProviderTest.php
- Raw: https://pluginprobe.com/plugins/packeta/2.0.9/raw/tests/Module/Shipping/ShippingProviderTest.php
- Modified: 2025-03-10T10:47:38+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/packeta/2.0.9/code/tests/Module/Shipping/ShippingProviderTest.php#L10-L20`.

```php
<?php

declare( strict_types=1 );

namespace Tests\Module\Shipping;

use Packetery\Module\Shipping\BaseShippingMethod;
use Packetery\Module\Shipping\ShippingProvider;
use Packetery\Module\ShippingMethod;
use PHPUnit\Framework\TestCase;

class ShippingProviderTest extends TestCase {
	/**
	 * @return array
	 */
	public static function shippingMethodsProvider(): array {
		return [
			[
				'methodId'        => 'free_shipping',
				'isPacketaMethod' => false,
			],
			[
				'methodId'        => 'flat_rate',
				'isPacketaMethod' => false,
			],
			[
				'methodId'        => ShippingMethod::PACKETERY_METHOD_ID,
				'isPacketaMethod' => true,
			],
			[
				'methodId'        => BaseShippingMethod::PACKETA_METHOD_PREFIX . 'zpointcz',
				'isPacketaMethod' => true,
			],
			[
				'methodId'        => BaseShippingMethod::PACKETA_METHOD_PREFIX . 'czzpoint',
				'isPacketaMethod' => true,
			],
			[
				'methodId'        => BaseShippingMethod::PACKETA_METHOD_PREFIX . '106',
				'isPacketaMethod' => true,
			],
		];
	}

	/**
	 * @dataProvider shippingMethodsProvider
	 */
	public function testIsPacketaMethod( $methodId, $isPacketaMethod ): void {
		self::assertEquals( $isPacketaMethod, ShippingProvider::isPacketaMethod( $methodId ) );
	}
}

```
