Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c2312c4

Browse files
committed
behat hostname fix
1 parent f5b3c76 commit c2312c4

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

features/product/viewing_products/viewing_products_from_specific_taxon_and_channel.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ Feature: Viewing products from a specific taxon and a channel
55
I want to be able to view products from a specific taxon and a channel
66

77
Background:
8-
Given the store operates on a channel named "Poland"
9-
And the store operates on another channel named "United States"
8+
Given the store operates on a channel named "Poland" with hostname "poland"
9+
And the store operates on another channel named "United States" with hostname "united-states"
1010
And the store classifies its products as "T-Shirts" and "Funny"
1111
And the store has a product "T-Shirt Banana" available in "Poland" channel
1212
And this product belongs to "T-Shirts"

src/Sylius/Behat/Context/Api/Shop/ProductContext.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function __construct(
5454
/**
5555
* @Given I am browsing channel :channel
5656
*/
57-
public function iAmBrowsingChannel(ChannelInterface $channel)
57+
public function iAmBrowsingChannel(ChannelInterface $channel): void
5858
{
5959
$this->sharedStorage->set('hostname', $channel->getHostname());
6060
}

src/Sylius/Behat/Context/Setup/ChannelContext.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,14 @@ public function storeOperatesOnASingleChannel($currencyCode = null)
111111
* @Given /^the store(?:| also) operates on (?:a|another) channel named "([^"]+)"$/
112112
* @Given /^the store(?:| also) operates on (?:a|another) channel named "([^"]+)" in "([^"]+)" currency$/
113113
* @Given the store operates on a channel identified by :code code
114-
* @Given the store (also) operates on a channel named :channelName with hostname :hostname
114+
* @Given the store (also) operates on a(nother) channel named :channelName with hostname :hostname
115115
*/
116116
public function theStoreOperatesOnAChannelNamed(string $channelName, string $currencyCode = null, string $hostname = null): void
117117
{
118118
$channelCode = StringInflector::nameToLowercaseCode($channelName);
119119
$defaultData = $this->defaultChannelFactory->create($channelCode, $channelName, $currencyCode);
120120

121-
$defaultData['channel']->setHostname(strtolower($hostname ?: str_replace(' ', '-', $channelName)));
121+
$defaultData['channel']->setHostname($hostname);
122122

123123
$this->sharedStorage->setClipboard($defaultData);
124124
$this->sharedStorage->set('channel', $defaultData['channel']);

0 commit comments

Comments
 (0)