File tree Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ class Service extends Enum
17
17
public const ROD = 'P20 ' ;
18
18
public const TYRES = 'P30 ' ;
19
19
public const PALLET = 'P90 ' ;
20
+ public const DRESSING_ROOM = '10001 ' ;
20
21
21
22
public static function delivery (): self
22
23
{
@@ -62,4 +63,9 @@ public static function pallet(): self
62
63
{
63
64
return static ::get (static ::PALLET );
64
65
}
66
+
67
+ public static function dressingRoom (): self
68
+ {
69
+ return static ::get (static ::DRESSING_ROOM );
70
+ }
65
71
}
Original file line number Diff line number Diff line change @@ -14,4 +14,9 @@ class AdditionalInfo
14
14
public array $ services = [];
15
15
public bool $ wheelchairAccessible ;
16
16
public bool $ parking ;
17
+
18
+ public function hasService (Service $ service ): bool
19
+ {
20
+ return \in_array ($ service , $ this ->services , true );
21
+ }
17
22
}
Original file line number Diff line number Diff line change 5
5
namespace Answear \DpdPlPickupServicesBundle \Tests \Service ;
6
6
7
7
use Answear \DpdPlPickupServicesBundle \Enum \Day ;
8
+ use Answear \DpdPlPickupServicesBundle \Enum \Service ;
8
9
use Answear \DpdPlPickupServicesBundle \Enum \Type ;
9
10
use Answear \DpdPlPickupServicesBundle \Service \PUDOFactory ;
10
11
use Answear \DpdPlPickupServicesBundle \ValueObject \Coordinates ;
@@ -42,6 +43,10 @@ public function dataIsCorrect(): void
42
43
self ::assertSame ('POL ' , $ pudo ->address ->country );
43
44
self ::assertEquals (new Coordinates (50.05874 , 19.97894 ), $ pudo ->coordinates );
44
45
self ::assertCount (3 , $ pudo ->additionalInfo ->services );
46
+ self ::assertTrue ($ pudo ->additionalInfo ->hasService (Service::delivery ()));
47
+ self ::assertTrue ($ pudo ->additionalInfo ->hasService (Service::dropoffOnline ()));
48
+ self ::assertTrue ($ pudo ->additionalInfo ->hasService (Service::dropoffOffline ()));
49
+ self ::assertFalse ($ pudo ->additionalInfo ->hasService (Service::swap ()));
45
50
self ::assertTrue ($ pudo ->additionalInfo ->parking );
46
51
self ::assertFalse ($ pudo ->additionalInfo ->wheelchairAccessible );
47
52
foreach ($ pudo ->opened as $ day => $ openings ) {
You can’t perform that action at this time.
0 commit comments