mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 09:02:12 +00:00
[Behat][Taxon] Specify taxon slug in specific language
This commit is contained in:
parent
7659db0514
commit
f3485e4ec3
10 changed files with 23 additions and 15 deletions
|
|
@ -13,7 +13,7 @@ Feature: Adding a new taxon
|
|||
Given I want to create a new taxon
|
||||
When I specify its code as "t-shirts"
|
||||
And I name it "T-Shirts" in "English (United States)"
|
||||
And I set its slug to "t-shirts"
|
||||
And I set its slug to "t-shirts" in "English (United States)"
|
||||
And I add it
|
||||
Then I should be notified that it has been successfully created
|
||||
And the "T-Shirts" taxon should appear in the registry
|
||||
|
|
@ -23,7 +23,7 @@ Feature: Adding a new taxon
|
|||
Given I want to create a new taxon
|
||||
When I specify its code as "category"
|
||||
And I name it "Category" in "English (United States)"
|
||||
And I set its slug to "category"
|
||||
And I set its slug to "category" in "English (United States)"
|
||||
And I describe it as "Main taxonomy for products." in "English (United States)"
|
||||
And I add it
|
||||
Then I should be notified that it has been successfully created
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ Feature: Adding a new taxon for parent
|
|||
Given I want to create a new taxon for "Category"
|
||||
And I specify its code as "guns"
|
||||
And I name it "Guns" in "English (United States)"
|
||||
And I set its slug to "guns"
|
||||
And I set its slug to "guns" in "English (United States)"
|
||||
And I add it
|
||||
Then I should be notified that it has been successfully created
|
||||
And the "Guns" taxon should appear in the registry
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ Feature: Editing a taxon
|
|||
Given I want to modify the "T-Shirts" taxon
|
||||
When I rename it to "Stickers" in "English (United States)"
|
||||
And I change its description to "Main taxonomy for stickers" in "English (United States)"
|
||||
And I set its slug to "stickers"
|
||||
And I set its slug to "stickers" in "English (United States)"
|
||||
And I change its parent taxon to "Accessories"
|
||||
And I save my changes
|
||||
Then I should be notified that it has been successfully edited
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ Feature: Editing taxon's slug
|
|||
Given I want to create a new taxon
|
||||
When I specify its code as "MEDIEVAL_WEAPONS"
|
||||
And I name it "Medieval weapons" in "English (United States)"
|
||||
And I set its slug to "mw"
|
||||
And I set its slug to "mw" in "English (United States)"
|
||||
And I add it
|
||||
Then this taxon slug should be "mw"
|
||||
|
||||
|
|
@ -40,7 +40,7 @@ Feature: Editing taxon's slug
|
|||
And I want to create a new taxon for "Medieval weapons"
|
||||
When I specify its code as "SIEGE_ENGINES"
|
||||
And I name it "Siege engines" in "English (United States)"
|
||||
And I set its slug to "medieval-weapons/siege"
|
||||
And I set its slug to "medieval-weapons/siege" in "English (United States)"
|
||||
And I add it
|
||||
Then this taxon slug should be "medieval-weapons/siege"
|
||||
|
||||
|
|
@ -73,7 +73,7 @@ Feature: Editing taxon's slug
|
|||
When I want to modify the "Medieval weapons" taxon
|
||||
And I enable slug modification
|
||||
And I rename it to "Renaissance weapons" in "English (United States)"
|
||||
And I set its slug to "renaissance"
|
||||
And I set its slug to "renaissance" in "English (United States)"
|
||||
And I save my changes
|
||||
Then the slug of the "Renaissance weapons" taxon should be "renaissance"
|
||||
|
||||
|
|
|
|||
|
|
@ -126,8 +126,9 @@ final class ManagingTaxonsContext implements Context
|
|||
/**
|
||||
* @When I set its slug to :slug
|
||||
* @When I do not specify its slug
|
||||
* @When I set its slug to :slug in :language
|
||||
*/
|
||||
public function iSetItsSlugTo($slug = null)
|
||||
public function iSetItsSlugToIn($slug = null, $language = 'en_US')
|
||||
{
|
||||
/** @var CreatePageInterface|UpdatePageInterface $currentPage */
|
||||
$currentPage = $this->currentPageResolver->getCurrentPageWithForm([
|
||||
|
|
@ -136,7 +137,7 @@ final class ManagingTaxonsContext implements Context
|
|||
$this->updatePage,
|
||||
]);
|
||||
|
||||
$currentPage->specifySlug($slug);
|
||||
$currentPage->specifySlug($slug, $language);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -105,9 +105,9 @@ class CreatePage extends BaseCreatePage implements CreatePageInterface
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function specifySlug($slug)
|
||||
public function specifySlug($slug, $languageCode)
|
||||
{
|
||||
$this->getDocument()->fillField('Slug', $slug);
|
||||
$this->getDocument()->fillField(sprintf('sylius_taxon_translations_%s_slug', $languageCode), $slug);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -72,8 +72,9 @@ interface CreatePageInterface extends BaseCreatePageInterface
|
|||
|
||||
/**
|
||||
* @param string $slug
|
||||
* @param string $languageCode
|
||||
*/
|
||||
public function specifySlug($slug);
|
||||
public function specifySlug($slug, $languageCode);
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
|
|
|
|||
|
|
@ -55,9 +55,9 @@ class UpdatePage extends BaseUpdatePage implements UpdatePageInterface
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function specifySlug($slug)
|
||||
public function specifySlug($slug, $languageCode)
|
||||
{
|
||||
$this->getDocument()->fillField('Slug', $slug);
|
||||
$this->getDocument()->fillField(sprintf('sylius_taxon_translations_%s_slug', $languageCode), $slug);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -44,8 +44,9 @@ interface UpdatePageInterface extends BaseUpdatePageInterface
|
|||
|
||||
/**
|
||||
* @param string $slug
|
||||
* @param string $languageCode
|
||||
*/
|
||||
public function specifySlug($slug);
|
||||
public function specifySlug($slug, $languageCode);
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
|
|
|
|||
|
|
@ -85,3 +85,8 @@ th {
|
|||
.ui.input input[readonly] {
|
||||
color: #aaa;
|
||||
}
|
||||
|
||||
.field.loading.transition {
|
||||
top: auto;
|
||||
left: auto;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue