forked from Sylius/Sylius
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Sylius#2218 from aRn0D/form-country
[AddressingBundle] The collection form type uses the new CollectionExtension
- Loading branch information
Showing
16 changed files
with
422 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Sylius package. | ||
* | ||
* (c) Paweł Jędrzejewski | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Sylius\Bundle\AddressingBundle\Behat; | ||
|
||
use Sylius\Bundle\ResourceBundle\Behat\FormContext as BaseFormContext; | ||
|
||
/** | ||
* @author Arnaud Langlade <arn0d.dev@gmail.com> | ||
*/ | ||
class FormContext extends BaseFormContext | ||
{ | ||
/** | ||
* @Given /^I remove all the provinces$/ | ||
*/ | ||
public function iRemoveAProvince() | ||
{ | ||
$items = count($this->getSession()->getPage()->findAll( | ||
'xpath', | ||
'//div[@id="sylius_country_provinces"]//div[@data-form-collection="item"]' | ||
)); | ||
|
||
while (0 !== $items) { | ||
$this->deleteCollectionItem($items); | ||
$items--; | ||
} | ||
} | ||
|
||
/** | ||
* @Given /^I fill in the (\d+)(st|nd|th) province with "([^""]*)"$/ | ||
*/ | ||
public function fillProvinceName($position, $fake, $value) | ||
{ | ||
$this->fillInField('sylius_country[provinces][' . ($position - 1) . '][name]', $value); | ||
} | ||
|
||
/** | ||
* @Given /^I select "([^""]*)" from the (\d+)(st|nd|th) country$/ | ||
*/ | ||
public function fillCountryMember($value, $position, $fake) | ||
{ | ||
$this->fillInField('sylius_country[members][' . ($position - 1) . '][country]', $value); | ||
} | ||
|
||
/** | ||
* @Given /^I remove the first country$/ | ||
*/ | ||
public function iRemoveTheFirstCountryMember() | ||
{ | ||
$this->deleteCollectionItem(1); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.