@@ -104,13 +104,71 @@ public function testCreateFromStructuredData(): void
104
104
);
105
105
}
106
106
107
- public function testEmptySpecs (): void
107
+ public function testIsAlwaysClosedWithUndefinedOpeningHoursAndUndefinedExceptions (): void
108
108
{
109
109
$ openingHours = OpeningHours::createFromStructuredData ([]);
110
110
111
111
$ this ->assertTrue ($ openingHours ->isAlwaysClosed ());
112
112
}
113
113
114
+ public function testIsAlwaysClosedWithEmptyOpeningHoursAndEmptyExceptions (): void
115
+ {
116
+ $ openingHours = OpeningHours::create ([
117
+ 'Monday ' => [],
118
+ 'Tuesday ' => [],
119
+ 'Wednesday ' => [],
120
+ 'Thursday ' => [],
121
+ 'Friday ' => [],
122
+ 'Saturday ' => [],
123
+ 'Sunday ' => [],
124
+ 'exceptions ' => [
125
+ '2023-12-24 ' => [],
126
+ ],
127
+ ]);
128
+
129
+ $ this ->assertTrue ($ openingHours ->isAlwaysClosed ());
130
+ }
131
+
132
+ public function testIsAlwaysOpenWithUndefinedOpeningHoursAndUndefinedExceptions (): void
133
+ {
134
+ $ openingHours = OpeningHours::createFromStructuredData ([]);
135
+
136
+ $ this ->assertFalse ($ openingHours ->isAlwaysOpen ());
137
+ }
138
+
139
+ public function testIsAlwaysOpenWithFilledOpeningHoursAndFilledExceptions (): void
140
+ {
141
+ $ openingHours = OpeningHours::create ([
142
+ 'Monday ' => ['00:00-24:00 ' ],
143
+ 'Tuesday ' => ['00:00-24:00 ' ],
144
+ 'Wednesday ' => ['00:00-24:00 ' ],
145
+ 'Thursday ' => ['00:00-24:00 ' ],
146
+ 'Friday ' => ['00:00-24:00 ' ],
147
+ 'Saturday ' => ['00:00-24:00 ' ],
148
+ 'Sunday ' => ['00:00-24:00 ' ],
149
+ 'exceptions ' => [
150
+ '2023-12-24 ' => ['00:00-24:00 ' ],
151
+ ],
152
+ ]);
153
+
154
+ $ this ->assertTrue ($ openingHours ->isAlwaysOpen ());
155
+ }
156
+
157
+ public function testIsAlwaysOpenWithFilledOpeningHoursAndUndefinedExceptions ()
158
+ {
159
+ $ openingHours = OpeningHours::create ([
160
+ 'Monday ' => ['00:00-24:00 ' ],
161
+ 'Tuesday ' => ['00:00-24:00 ' ],
162
+ 'Wednesday ' => ['00:00-24:00 ' ],
163
+ 'Thursday ' => ['00:00-24:00 ' ],
164
+ 'Friday ' => ['00:00-24:00 ' ],
165
+ 'Saturday ' => ['00:00-24:00 ' ],
166
+ 'Sunday ' => ['00:00-24:00 ' ],
167
+ ]);
168
+
169
+ $ this ->assertTrue ($ openingHours ->isAlwaysOpen ());
170
+ }
171
+
114
172
public function testRangeOverNight (): void
115
173
{
116
174
$ openingHours = OpeningHours::createFromStructuredData ([
0 commit comments