1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of the Sylius package. |
5
|
|
|
* |
6
|
|
|
* (c) Paweł Jędrzejewski |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
9
|
|
|
* file that was distributed with this source code. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
declare(strict_types=1); |
13
|
|
|
|
14
|
|
|
namespace Sylius\Behat\Context\Ui\Admin; |
15
|
|
|
|
16
|
|
|
use Behat\Behat\Context\Context; |
17
|
|
|
use Sylius\Behat\NotificationType; |
18
|
|
|
use Sylius\Behat\Page\Admin\Channel\CreatePageInterface; |
19
|
|
|
use Sylius\Behat\Page\Admin\Channel\UpdatePageInterface; |
20
|
|
|
use Sylius\Behat\Page\Admin\Crud\IndexPageInterface; |
21
|
|
|
use Sylius\Behat\Service\NotificationCheckerInterface; |
22
|
|
|
use Sylius\Behat\Service\Resolver\CurrentPageResolverInterface; |
23
|
|
|
use Sylius\Component\Channel\Model\ChannelTypes; |
24
|
|
|
use Sylius\Component\Core\Formatter\StringInflector; |
25
|
|
|
use Sylius\Component\Core\Model\ChannelInterface; |
26
|
|
|
use Sylius\Component\Currency\Model\CurrencyInterface; |
27
|
|
|
use Webmozart\Assert\Assert; |
28
|
|
|
|
29
|
|
|
final class ManagingChannelsContext implements Context |
30
|
|
|
{ |
31
|
|
|
/** @var IndexPageInterface */ |
32
|
|
|
private $indexPage; |
33
|
|
|
|
34
|
|
|
/** @var CreatePageInterface */ |
35
|
|
|
private $createPage; |
36
|
|
|
|
37
|
|
|
/** @var UpdatePageInterface */ |
38
|
|
|
private $updatePage; |
39
|
|
|
|
40
|
|
|
/** @var CurrentPageResolverInterface */ |
41
|
|
|
private $currentPageResolver; |
42
|
|
|
|
43
|
|
|
/** @var NotificationCheckerInterface */ |
44
|
|
|
private $notificationChecker; |
45
|
|
|
|
46
|
|
|
public function __construct( |
47
|
|
|
IndexPageInterface $indexPage, |
48
|
|
|
CreatePageInterface $createPage, |
49
|
|
|
UpdatePageInterface $updatePage, |
50
|
|
|
CurrentPageResolverInterface $currentPageResolver, |
51
|
|
|
NotificationCheckerInterface $notificationChecker |
52
|
|
|
) { |
53
|
|
|
$this->indexPage = $indexPage; |
54
|
|
|
$this->createPage = $createPage; |
55
|
|
|
$this->updatePage = $updatePage; |
56
|
|
|
$this->currentPageResolver = $currentPageResolver; |
57
|
|
|
$this->notificationChecker = $notificationChecker; |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
/** |
61
|
|
|
* @Given I want to create a new channel |
62
|
|
|
*/ |
63
|
|
|
public function iWantToCreateANewChannel() |
64
|
|
|
{ |
65
|
|
|
$this->createPage->open(); |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* @When I specify its code as :code |
70
|
|
|
* @When I do not specify its code |
71
|
|
|
*/ |
72
|
|
|
public function iSpecifyItsCodeAs($code = null) |
73
|
|
|
{ |
74
|
|
|
$this->createPage->specifyCode($code ?? ''); |
75
|
|
|
} |
76
|
|
|
|
77
|
|
|
/** |
78
|
|
|
* @When I name it :name |
79
|
|
|
* @When I rename it to :name |
80
|
|
|
* @When I do not name it |
81
|
|
|
* @When I remove its name |
82
|
|
|
*/ |
83
|
|
|
public function iNameIt($name = null) |
84
|
|
|
{ |
85
|
|
|
$this->createPage->nameIt($name ?? ''); |
86
|
|
|
} |
87
|
|
|
|
88
|
|
|
/** |
89
|
|
|
* @When I choose :currency as the base currency |
90
|
|
|
* @When I do not choose base currency |
91
|
|
|
*/ |
92
|
|
|
public function iChooseAsABaseCurrency(?CurrencyInterface $currency = null) |
93
|
|
|
{ |
94
|
|
|
$this->createPage->chooseBaseCurrency($currency ? $currency->getName() : null); |
95
|
|
|
} |
96
|
|
|
|
97
|
|
|
/** |
98
|
|
|
* @When I choose :locale as a default locale |
99
|
|
|
* @When I do not choose default locale |
100
|
|
|
*/ |
101
|
|
|
public function iChooseAsADefaultLocale($locale = null) |
102
|
|
|
{ |
103
|
|
|
$this->createPage->chooseDefaultLocale($locale); |
104
|
|
|
} |
105
|
|
|
|
106
|
|
|
/** |
107
|
|
|
* @When I allow to skip shipping step if only one shipping method is available |
108
|
|
|
*/ |
109
|
|
|
public function iAllowToSkipShippingStepIfOnlyOneShippingMethodIsAvailable() |
110
|
|
|
{ |
111
|
|
|
$this->createPage->allowToSkipShippingStep(); |
112
|
|
|
} |
113
|
|
|
|
114
|
|
|
/** |
115
|
|
|
* @When I allow to skip payment step if only one payment method is available |
116
|
|
|
*/ |
117
|
|
|
public function iAllowToSkipPaymentStepIfOnlyOnePaymentMethodIsAvailable() |
118
|
|
|
{ |
119
|
|
|
$this->createPage->allowToSkipPaymentStep(); |
120
|
|
|
} |
121
|
|
|
|
122
|
|
|
/** |
123
|
|
|
* @When I add it |
124
|
|
|
* @When I try to add it |
125
|
|
|
*/ |
126
|
|
|
public function iAddIt() |
127
|
|
|
{ |
128
|
|
|
$this->createPage->create(); |
129
|
|
|
} |
130
|
|
|
|
131
|
|
|
/** |
132
|
|
|
* @Then I should see the channel :channelName in the list |
133
|
|
|
* @Then the channel :channelName should appear in the registry |
134
|
|
|
* @Then the channel :channelName should be in the registry |
135
|
|
|
*/ |
136
|
|
|
public function theChannelShouldAppearInTheRegistry(string $channelName): void |
137
|
|
|
{ |
138
|
|
|
$this->iWantToBrowseChannels(); |
139
|
|
|
|
140
|
|
|
Assert::true($this->indexPage->isSingleResourceOnPage(['nameAndDescription' => $channelName])); |
141
|
|
|
} |
142
|
|
|
|
143
|
|
|
/** |
144
|
|
|
* @Then /^(this channel) should still be in the registry$/ |
145
|
|
|
*/ |
146
|
|
|
public function thisChannelShouldAppearInTheRegistry(ChannelInterface $channel) |
147
|
|
|
{ |
148
|
|
|
$this->theChannelShouldAppearInTheRegistry($channel->getName()); |
149
|
|
|
} |
150
|
|
|
|
151
|
|
|
/** |
152
|
|
|
* @When I describe it as :description |
153
|
|
|
*/ |
154
|
|
|
public function iDescribeItAs($description) |
155
|
|
|
{ |
156
|
|
|
$this->createPage->describeItAs($description); |
157
|
|
|
} |
158
|
|
|
|
159
|
|
|
/** |
160
|
|
|
* @When I set its hostname as :hostname |
161
|
|
|
*/ |
162
|
|
|
public function iSetItsHostnameAs($hostname) |
163
|
|
|
{ |
164
|
|
|
$this->createPage->setHostname($hostname); |
165
|
|
|
} |
166
|
|
|
|
167
|
|
|
/** |
168
|
|
|
* @When I set its contact email as :contactEmail |
169
|
|
|
*/ |
170
|
|
|
public function iSetItsContactEmailAs($contactEmail) |
171
|
|
|
{ |
172
|
|
|
$this->createPage->setContactEmail($contactEmail); |
173
|
|
|
} |
174
|
|
|
|
175
|
|
|
/** |
176
|
|
|
* @When I define its color as :color |
177
|
|
|
*/ |
178
|
|
|
public function iDefineItsColorAs($color) |
179
|
|
|
{ |
180
|
|
|
$this->createPage->defineColor($color); |
181
|
|
|
} |
182
|
|
|
|
183
|
|
|
/** |
184
|
|
|
* @When I enable it |
185
|
|
|
*/ |
186
|
|
|
public function iEnableIt() |
187
|
|
|
{ |
188
|
|
|
$this->updatePage->enable(); |
189
|
|
|
} |
190
|
|
|
|
191
|
|
|
/** |
192
|
|
|
* @When I disable it |
193
|
|
|
*/ |
194
|
|
|
public function iDisableIt() |
195
|
|
|
{ |
196
|
|
|
/** @var CreatePageInterface|UpdatePageInterface $currentPage */ |
197
|
|
|
$currentPage = $this->currentPageResolver->getCurrentPageWithForm([$this->createPage, $this->updatePage]); |
198
|
|
|
|
199
|
|
|
$currentPage->disable(); |
200
|
|
|
} |
201
|
|
|
|
202
|
|
|
/** |
203
|
|
|
* @Then I should be notified that at least one channel has to be defined |
204
|
|
|
*/ |
205
|
|
|
public function iShouldBeNotifiedThatAtLeastOneChannelHasToBeDefinedIsRequired() |
206
|
|
|
{ |
207
|
|
|
/** @var CreatePageInterface|UpdatePageInterface $currentPage */ |
208
|
|
|
$currentPage = $this->currentPageResolver->getCurrentPageWithForm([$this->createPage, $this->updatePage]); |
209
|
|
|
|
210
|
|
|
Assert::same($currentPage->getValidationMessage('enabled'), 'Must have at least one enabled entity'); |
211
|
|
|
} |
212
|
|
|
|
213
|
|
|
/** |
214
|
|
|
* @Then channel with :element :value should not be added |
215
|
|
|
*/ |
216
|
|
|
public function channelWithShouldNotBeAdded($element, $value) |
217
|
|
|
{ |
218
|
|
|
$this->iWantToBrowseChannels(); |
219
|
|
|
|
220
|
|
|
Assert::false($this->indexPage->isSingleResourceOnPage([$element => $value])); |
221
|
|
|
} |
222
|
|
|
|
223
|
|
|
/** |
224
|
|
|
* @Then /^I should be notified that ([^"]+) is required$/ |
225
|
|
|
*/ |
226
|
|
|
public function iShouldBeNotifiedThatIsRequired($element) |
227
|
|
|
{ |
228
|
|
|
/** @var CreatePageInterface|UpdatePageInterface $currentPage */ |
229
|
|
|
$currentPage = $this->currentPageResolver->getCurrentPageWithForm([$this->createPage, $this->updatePage]); |
230
|
|
|
|
231
|
|
|
Assert::same( |
232
|
|
|
$currentPage->getValidationMessage(StringInflector::nameToCode($element)), |
233
|
|
|
sprintf('Please enter channel %s.', $element) |
234
|
|
|
); |
235
|
|
|
} |
236
|
|
|
|
237
|
|
|
/** |
238
|
|
|
* @Given I am modifying a channel :channel |
239
|
|
|
* @When I want to modify a channel :channel |
240
|
|
|
* @When /^I want to modify (this channel)$/ |
241
|
|
|
*/ |
242
|
|
|
public function iWantToModifyChannel(ChannelInterface $channel): void |
243
|
|
|
{ |
244
|
|
|
$this->updatePage->open(['id' => $channel->getId()]); |
245
|
|
|
} |
246
|
|
|
|
247
|
|
|
/** |
248
|
|
|
* @Then /^(this channel) name should be "([^"]+)"$/ |
249
|
|
|
* @Then /^(this channel) should still be named "([^"]+)"$/ |
250
|
|
|
*/ |
251
|
|
|
public function thisChannelNameShouldBe(ChannelInterface $channel, $channelName) |
252
|
|
|
{ |
253
|
|
|
$this->iWantToBrowseChannels(); |
254
|
|
|
|
255
|
|
|
Assert::true($this->indexPage->isSingleResourceOnPage([ |
256
|
|
|
'code' => $channel->getCode(), |
257
|
|
|
'nameAndDescription' => $channelName, |
258
|
|
|
])); |
259
|
|
|
} |
260
|
|
|
|
261
|
|
|
/** |
262
|
|
|
* @When I save my changes |
263
|
|
|
* @When I try to save my changes |
264
|
|
|
*/ |
265
|
|
|
public function iSaveMyChanges() |
266
|
|
|
{ |
267
|
|
|
$this->updatePage->saveChanges(); |
268
|
|
|
} |
269
|
|
|
|
270
|
|
|
/** |
271
|
|
|
* @When /^I define its type as (mobile|website|pos)$/ |
272
|
|
|
*/ |
273
|
|
|
public function iDefineItsTypeAs(string $type): void |
274
|
|
|
{ |
275
|
|
|
$this->createPage->setType($type); |
276
|
|
|
} |
277
|
|
|
|
278
|
|
|
/** |
279
|
|
|
* @Then I should be notified that channel with this code already exists |
280
|
|
|
*/ |
281
|
|
|
public function iShouldBeNotifiedThatChannelWithThisCodeAlreadyExists() |
282
|
|
|
{ |
283
|
|
|
Assert::same($this->createPage->getValidationMessage('code'), 'Channel code has to be unique.'); |
284
|
|
|
} |
285
|
|
|
|
286
|
|
|
/** |
287
|
|
|
* @Then there should still be only one channel with :element :value |
288
|
|
|
*/ |
289
|
|
|
public function thereShouldStillBeOnlyOneChannelWithCode($element, $value) |
290
|
|
|
{ |
291
|
|
|
$this->iWantToBrowseChannels(); |
292
|
|
|
|
293
|
|
|
Assert::true($this->indexPage->isSingleResourceOnPage([$element => $value])); |
294
|
|
|
} |
295
|
|
|
|
296
|
|
|
/** |
297
|
|
|
* @When I browse channels |
298
|
|
|
* @When I want to browse channels |
299
|
|
|
*/ |
300
|
|
|
public function iWantToBrowseChannels(): void |
301
|
|
|
{ |
302
|
|
|
$this->indexPage->open(); |
303
|
|
|
} |
304
|
|
|
|
305
|
|
|
/** |
306
|
|
|
* @When I check (also) the :channelName channel |
307
|
|
|
*/ |
308
|
|
|
public function iCheckTheChannel(string $channelName): void |
309
|
|
|
{ |
310
|
|
|
$this->indexPage->checkResourceOnPage(['nameAndDescription' => $channelName]); |
311
|
|
|
} |
312
|
|
|
|
313
|
|
|
/** |
314
|
|
|
* @When I delete them |
315
|
|
|
*/ |
316
|
|
|
public function iDeleteThem(): void |
317
|
|
|
{ |
318
|
|
|
$this->indexPage->bulkDelete(); |
319
|
|
|
} |
320
|
|
|
|
321
|
|
|
/** |
322
|
|
|
* @Then I should see a single channel in the list |
323
|
|
|
* @Then I should see :numberOfChannels channels in the list |
324
|
|
|
*/ |
325
|
|
|
public function iShouldSeeChannelsInTheList(int $numberOfChannels = 1): void |
326
|
|
|
{ |
327
|
|
|
Assert::same($this->indexPage->countItems(), $numberOfChannels); |
328
|
|
|
} |
329
|
|
|
|
330
|
|
|
/** |
331
|
|
|
* @Then the code field should be disabled |
332
|
|
|
*/ |
333
|
|
|
public function theCodeFieldShouldBeDisabled() |
334
|
|
|
{ |
335
|
|
|
Assert::true($this->updatePage->isCodeDisabled()); |
336
|
|
|
} |
337
|
|
|
|
338
|
|
|
/** |
339
|
|
|
* @Then /^(this channel) should be disabled$/ |
340
|
|
|
*/ |
341
|
|
|
public function thisChannelShouldBeDisabled(ChannelInterface $channel) |
342
|
|
|
{ |
343
|
|
|
$this->assertChannelState($channel, false); |
344
|
|
|
} |
345
|
|
|
|
346
|
|
|
/** |
347
|
|
|
* @Then /^(this channel) should be enabled$/ |
348
|
|
|
* @Then channel with name :channel should still be enabled |
349
|
|
|
*/ |
350
|
|
|
public function thisChannelShouldBeEnabled(ChannelInterface $channel) |
351
|
|
|
{ |
352
|
|
|
$this->assertChannelState($channel, true); |
353
|
|
|
} |
354
|
|
|
|
355
|
|
|
/** |
356
|
|
|
* @When I delete channel :channel |
357
|
|
|
*/ |
358
|
|
|
public function iDeleteChannel(ChannelInterface $channel) |
359
|
|
|
{ |
360
|
|
|
$this->indexPage->open(); |
361
|
|
|
$this->indexPage->deleteResourceOnPage(['nameAndDescription' => $channel->getName()]); |
362
|
|
|
} |
363
|
|
|
|
364
|
|
|
/** |
365
|
|
|
* @Then the :channelName channel should no longer exist in the registry |
366
|
|
|
*/ |
367
|
|
|
public function thisChannelShouldNoLongerExistInTheRegistry($channelName) |
368
|
|
|
{ |
369
|
|
|
Assert::false($this->indexPage->isSingleResourceOnPage(['nameAndDescription' => $channelName])); |
370
|
|
|
} |
371
|
|
|
|
372
|
|
|
/** |
373
|
|
|
* @Then I should be notified that it cannot be deleted |
374
|
|
|
*/ |
375
|
|
|
public function iShouldBeNotifiedThatItCannotBeDeleted() |
376
|
|
|
{ |
377
|
|
|
$this->notificationChecker->checkNotification( |
378
|
|
|
'The channel cannot be deleted. At least one enabled channel is required.', |
379
|
|
|
NotificationType::failure() |
380
|
|
|
); |
381
|
|
|
} |
382
|
|
|
|
383
|
|
|
/** |
384
|
|
|
* @When I make it available (only) in :locale |
385
|
|
|
*/ |
386
|
|
|
public function iMakeItAvailableIn(string $localeName): void |
387
|
|
|
{ |
388
|
|
|
/** @var CreatePageInterface|UpdatePageInterface $currentPage */ |
389
|
|
|
$currentPage = $this->currentPageResolver->getCurrentPageWithForm([$this->createPage, $this->updatePage]); |
390
|
|
|
|
391
|
|
|
$currentPage->chooseLocale($localeName); |
392
|
|
|
} |
393
|
|
|
|
394
|
|
|
/** |
395
|
|
|
* @Then the channel :channel should be available in :locale |
396
|
|
|
*/ |
397
|
|
|
public function theChannelShouldBeAvailableIn(ChannelInterface $channel, $locale) |
398
|
|
|
{ |
399
|
|
|
$this->updatePage->open(['id' => $channel->getId()]); |
400
|
|
|
|
401
|
|
|
Assert::true($this->updatePage->isLocaleChosen($locale)); |
402
|
|
|
} |
403
|
|
|
|
404
|
|
|
/** |
405
|
|
|
* @When I allow for paying in :currencyCode |
406
|
|
|
*/ |
407
|
|
|
public function iAllowToPayingForThisChannel($currencyCode) |
408
|
|
|
{ |
409
|
|
|
/** @var CreatePageInterface|UpdatePageInterface $currentPage */ |
410
|
|
|
$currentPage = $this->currentPageResolver->getCurrentPageWithForm([$this->createPage, $this->updatePage]); |
411
|
|
|
|
412
|
|
|
$currentPage->chooseCurrency($currencyCode); |
413
|
|
|
} |
414
|
|
|
|
415
|
|
|
/** |
416
|
|
|
* @Then paying in :currencyCode should be possible for the :channel channel |
417
|
|
|
*/ |
418
|
|
|
public function payingInEuroShouldBePossibleForTheChannel($currencyCode, ChannelInterface $channel) |
419
|
|
|
{ |
420
|
|
|
$this->updatePage->open(['id' => $channel->getId()]); |
421
|
|
|
|
422
|
|
|
Assert::true($this->updatePage->isCurrencyChosen($currencyCode)); |
423
|
|
|
} |
424
|
|
|
|
425
|
|
|
/** |
426
|
|
|
* @When I select the :taxZone as default tax zone |
427
|
|
|
*/ |
428
|
|
|
public function iSelectDefaultTaxZone($taxZone) |
429
|
|
|
{ |
430
|
|
|
/** @var CreatePageInterface|UpdatePageInterface $currentPage */ |
431
|
|
|
$currentPage = $this->currentPageResolver->getCurrentPageWithForm([$this->createPage, $this->updatePage]); |
432
|
|
|
|
433
|
|
|
$currentPage->chooseDefaultTaxZone($taxZone); |
434
|
|
|
} |
435
|
|
|
|
436
|
|
|
/** |
437
|
|
|
* @Given I remove its default tax zone |
438
|
|
|
*/ |
439
|
|
|
public function iRemoveItsDefaultTaxZone() |
440
|
|
|
{ |
441
|
|
|
$this->updatePage->chooseDefaultTaxZone(''); |
442
|
|
|
} |
443
|
|
|
|
444
|
|
|
/** |
445
|
|
|
* @When I select the :taxCalculationStrategy as tax calculation strategy |
446
|
|
|
*/ |
447
|
|
|
public function iSelectTaxCalculationStrategy($taxCalculationStrategy) |
448
|
|
|
{ |
449
|
|
|
/** @var CreatePageInterface|UpdatePageInterface $currentPage */ |
450
|
|
|
$currentPage = $this->currentPageResolver->getCurrentPageWithForm([$this->createPage, $this->updatePage]); |
451
|
|
|
|
452
|
|
|
$currentPage->chooseTaxCalculationStrategy($taxCalculationStrategy); |
453
|
|
|
} |
454
|
|
|
|
455
|
|
|
/** |
456
|
|
|
* @Then the default tax zone for the :channel channel should be :taxZone |
457
|
|
|
*/ |
458
|
|
|
public function theDefaultTaxZoneForTheChannelShouldBe(ChannelInterface $channel, $taxZone) |
459
|
|
|
{ |
460
|
|
|
$this->updatePage->open(['id' => $channel->getId()]); |
461
|
|
|
|
462
|
|
|
Assert::true($this->updatePage->isDefaultTaxZoneChosen($taxZone)); |
463
|
|
|
} |
464
|
|
|
|
465
|
|
|
/** |
466
|
|
|
* @When /^I change its type to (mobile|website|pos)$/ |
467
|
|
|
*/ |
468
|
|
|
public function iChangeItsTypeTo(string $type): void |
469
|
|
|
{ |
470
|
|
|
$this->updatePage->changeType($type); |
471
|
|
|
} |
472
|
|
|
|
473
|
|
|
/** |
474
|
|
|
* @Given channel :channel should not have default tax zone |
475
|
|
|
*/ |
476
|
|
|
public function channelShouldNotHaveDefaultTaxZone(ChannelInterface $channel) |
477
|
|
|
{ |
478
|
|
|
$this->updatePage->open(['id' => $channel->getId()]); |
479
|
|
|
|
480
|
|
|
Assert::false($this->updatePage->isAnyDefaultTaxZoneChosen()); |
481
|
|
|
} |
482
|
|
|
|
483
|
|
|
/** |
484
|
|
|
* @Then the tax calculation strategy for the :channel channel should be :taxCalculationStrategy |
485
|
|
|
*/ |
486
|
|
|
public function theTaxCalculationStrategyForTheChannelShouldBe(ChannelInterface $channel, $taxCalculationStrategy) |
487
|
|
|
{ |
488
|
|
|
$this->updatePage->open(['id' => $channel->getId()]); |
489
|
|
|
|
490
|
|
|
Assert::true($this->updatePage->isTaxCalculationStrategyChosen($taxCalculationStrategy)); |
491
|
|
|
} |
492
|
|
|
|
493
|
|
|
/** |
494
|
|
|
* @Then the base currency field should be disabled |
495
|
|
|
*/ |
496
|
|
|
public function theBaseCurrencyFieldShouldBeDisabled() |
497
|
|
|
{ |
498
|
|
|
Assert::true($this->updatePage->isBaseCurrencyDisabled()); |
499
|
|
|
} |
500
|
|
|
|
501
|
|
|
/** |
502
|
|
|
* @Then I should be notified that the default locale has to be enabled |
503
|
|
|
*/ |
504
|
|
|
public function iShouldBeNotifiedThatTheDefaultLocaleHasToBeEnabled(): void |
505
|
|
|
{ |
506
|
|
|
Assert::same( |
507
|
|
|
$this->updatePage->getValidationMessage('default_locale'), |
508
|
|
|
'Default locale has to be enabled.' |
509
|
|
|
); |
510
|
|
|
} |
511
|
|
|
|
512
|
|
|
/** |
513
|
|
|
* @Then /^this channel type should be (mobile|website|pos)$/ |
514
|
|
|
*/ |
515
|
|
|
public function thisChannelTypeShouldBe(string $type): void |
516
|
|
|
{ |
517
|
|
|
Assert::same($this->updatePage->getType(), $type); |
518
|
|
|
} |
519
|
|
|
|
520
|
|
|
/** |
521
|
|
|
* @param bool $state |
522
|
|
|
*/ |
523
|
|
|
private function assertChannelState(ChannelInterface $channel, $state) |
524
|
|
|
{ |
525
|
|
|
$this->iWantToBrowseChannels(); |
526
|
|
|
|
527
|
|
|
Assert::true($this->indexPage->isSingleResourceOnPage([ |
528
|
|
|
'nameAndDescription' => $channel->getName(), |
529
|
|
|
'enabled' => $state ? 'Enabled' : 'Disabled', |
530
|
|
|
])); |
531
|
|
|
} |
532
|
|
|
} |
533
|
|
|
|