PluginProbe
Packeta / 2.0.9
Packeta v2.0.9
2.3.2 2.3.1 trunk 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.3.0 1.3.1 1.3.2 1.4 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 All 56 releases
packeta / tests / Module / Shipping / ShippingProviderTest.php

ShippingProviderTest.php in Packeta 2.0.9, at tests/Module/Shipping/ShippingProviderTest.php

52 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare( strict_types=1 );
4
5 namespace Tests\Module\Shipping;
6
7 use Packetery\Module\Shipping\BaseShippingMethod;
8 use Packetery\Module\Shipping\ShippingProvider;
9 use Packetery\Module\ShippingMethod;
10 use PHPUnit\Framework\TestCase;
11
12 class ShippingProviderTest extends TestCase {
13 /**
14 * @return array
15 */
16 public static function shippingMethodsProvider(): array {
17 return [
18 [
19 'methodId' => 'free_shipping',
20 'isPacketaMethod' => false,
21 ],
22 [
23 'methodId' => 'flat_rate',
24 'isPacketaMethod' => false,
25 ],
26 [
27 'methodId' => ShippingMethod::PACKETERY_METHOD_ID,
28 'isPacketaMethod' => true,
29 ],
30 [
31 'methodId' => BaseShippingMethod::PACKETA_METHOD_PREFIX . 'zpointcz',
32 'isPacketaMethod' => true,
33 ],
34 [
35 'methodId' => BaseShippingMethod::PACKETA_METHOD_PREFIX . 'czzpoint',
36 'isPacketaMethod' => true,
37 ],
38 [
39 'methodId' => BaseShippingMethod::PACKETA_METHOD_PREFIX . '106',
40 'isPacketaMethod' => true,
41 ],
42 ];
43 }
44
45 /**
46 * @dataProvider shippingMethodsProvider
47 */
48 public function testIsPacketaMethod( $methodId, $isPacketaMethod ): void {
49 self::assertEquals( $isPacketaMethod, ShippingProvider::isPacketaMethod( $methodId ) );
50 }
51 }
52