Rename isResourceOnPage to isSingleResourceOnPage from Crud IndexPage

This commit is contained in:
tuka217 2016-04-25 09:58:31 +02:00
parent 7697f01c68
commit 8134229c4b
13 changed files with 46 additions and 46 deletions

View file

@ -127,7 +127,7 @@ final class ManagingChannelsContext implements Context
{
$this->iWantToBrowseChannels();
Assert::true($this->indexPage->isResourceOnPage(
Assert::true($this->indexPage->isSingleResourceOnPage(
['name' => $channelName]),
sprintf('Channel with name %s has not been found.', $channelName)
);
@ -204,7 +204,7 @@ final class ManagingChannelsContext implements Context
$this->iWantToBrowseChannels();
Assert::false(
$this->indexPage->isResourceOnPage([$element => $value]),
$this->indexPage->isSingleResourceOnPage([$element => $value]),
sprintf('Channel with %s "%s" was created, but it should not.', $element, $value)
);
}
@ -240,7 +240,7 @@ final class ManagingChannelsContext implements Context
$this->iWantToBrowseChannels();
Assert::true(
$this->indexPage->isResourceOnPage(
$this->indexPage->isSingleResourceOnPage(
[
'code' => $channel->getCode(),
'name' => $channelName,
@ -278,7 +278,7 @@ final class ManagingChannelsContext implements Context
$this->iWantToBrowseChannels();
Assert::true(
$this->indexPage->isResourceOnPage([$element => $value]),
$this->indexPage->isSingleResourceOnPage([$element => $value]),
sprintf('Channel with %s %s cannot be found.', $element, $value)
);
}
@ -356,7 +356,7 @@ final class ManagingChannelsContext implements Context
public function thisChannelShouldNoLongerExistInTheRegistry($channelName)
{
Assert::false(
$this->indexPage->isResourceOnPage(['name' => $channelName]),
$this->indexPage->isSingleResourceOnPage(['name' => $channelName]),
sprintf('Channel with name %s exists but should not.', $channelName)
);
}
@ -481,7 +481,7 @@ final class ManagingChannelsContext implements Context
$this->iWantToBrowseChannels();
Assert::true(
$this->indexPage->isResourceOnPage(
$this->indexPage->isSingleResourceOnPage(
[
'name' => $channel->getName(),
'enabled' => $state,

View file

@ -167,7 +167,7 @@ final class ManagingCountriesContext implements Context
$this->indexPage->open();
Assert::true(
$this->indexPage->isResourceOnPage(['code' => $country->getCode()]),
$this->indexPage->isSingleResourceOnPage(['code' => $country->getCode()]),
sprintf('Country %s should exist but it does not', $country->getCode())
);
}

View file

@ -123,7 +123,7 @@ final class ManagingCurrenciesContext implements Context
$this->indexPage->open();
Assert::true(
$this->indexPage->isResourceOnPage(['code' => $currency->getCode()]),
$this->indexPage->isSingleResourceOnPage(['code' => $currency->getCode()]),
sprintf('Currency %s should exist but it does not.', $currency->getCode())
);
}
@ -250,7 +250,7 @@ final class ManagingCurrenciesContext implements Context
$this->indexPage->open();
Assert::true(
$this->indexPage->isResourceOnPage([$element => $codeValue]),
$this->indexPage->isSingleResourceOnPage([$element => $codeValue]),
sprintf('Currency with %s %s cannot be found.', $element, $codeValue)
);
}
@ -276,7 +276,7 @@ final class ManagingCurrenciesContext implements Context
$this->indexPage->open();
Assert::false(
$this->indexPage->isResourceOnPage(['name' => $currencyName]),
$this->indexPage->isSingleResourceOnPage(['name' => $currencyName]),
sprintf('Currency with name %s was created, but it should not.', $currencyName)
);
}

View file

@ -123,7 +123,7 @@ final class ManagingCustomersContext implements Context
$this->indexPage->open();
Assert::true(
$this->indexPage->isResourceOnPage(['Email' => $customer->getEmail()]),
$this->indexPage->isSingleResourceOnPage(['Email' => $customer->getEmail()]),
sprintf('Customer with email %s should exist but it does not.', $customer->getEmail())
);
}
@ -209,7 +209,7 @@ final class ManagingCustomersContext implements Context
public function iShouldSeeTheCustomerInTheList($email)
{
Assert::true(
$this->indexPage->isResourceOnPage(['Email' => $email]),
$this->indexPage->isSingleResourceOnPage(['Email' => $email]),
sprintf('Customer with email %s should exist but it does not.', $email)
);
}
@ -233,7 +233,7 @@ final class ManagingCustomersContext implements Context
$this->indexPage->open();
Assert::false(
$this->indexPage->isResourceOnPage(['email' => $email]),
$this->indexPage->isSingleResourceOnPage(['email' => $email]),
sprintf('Customer with email %s was created, but it should not.', $email)
);
}
@ -320,7 +320,7 @@ final class ManagingCustomersContext implements Context
$this->indexPage->open();
Assert::true(
$this->indexPage->isResourceOnPage(['email' => $email]),
$this->indexPage->isSingleResourceOnPage(['email' => $email]),
sprintf('Customer with email %s cannot be found.', $email)
);
}

View file

@ -142,7 +142,7 @@ final class ManagingLocalesContext implements Context
*/
public function storeShouldBeAvailableInLanguage($name)
{
$doesLocaleExist = $this->indexPage->isResourceOnPage(['name' => $name]);
$doesLocaleExist = $this->indexPage->isSingleResourceOnPage(['name' => $name]);
Assert::true(
$doesLocaleExist,
sprintf('Locale %s should exist but it does not', $name)

View file

@ -216,7 +216,7 @@ final class ManagingPaymentMethodsContext implements Context
$this->indexPage->open();
Assert::true(
$this->indexPage->isResourceOnPage(['name' => $paymentMethodName]),
$this->indexPage->isSingleResourceOnPage(['name' => $paymentMethodName]),
sprintf('Payment method with name %s has not been found.', $paymentMethodName)
);
}
@ -259,7 +259,7 @@ final class ManagingPaymentMethodsContext implements Context
$this->iBrowsePaymentMethods();
Assert::false(
$this->indexPage->isResourceOnPage([$element => $value]),
$this->indexPage->isSingleResourceOnPage([$element => $value]),
sprintf('Payment method with %s %s was created, but it should not.', $element, $value)
);
}
@ -272,7 +272,7 @@ final class ManagingPaymentMethodsContext implements Context
$this->iBrowsePaymentMethods();
Assert::true(
$this->indexPage->isResourceOnPage([
$this->indexPage->isSingleResourceOnPage([
'code' => $paymentMethod->getCode(),
'name' => $paymentMethodName,
]),
@ -341,7 +341,7 @@ final class ManagingPaymentMethodsContext implements Context
public function thisPaymentMethodShouldNoLongerExistInTheRegistry(PaymentMethodInterface $paymentMethod)
{
Assert::false(
$this->indexPage->isResourceOnPage(['code' => $paymentMethod->getCode(), 'name' => $paymentMethod->getName()]),
$this->indexPage->isSingleResourceOnPage(['code' => $paymentMethod->getCode(), 'name' => $paymentMethod->getName()]),
sprintf('Payment method %s should no longer exist in the registry', $paymentMethod->getName())
);
}
@ -365,7 +365,7 @@ final class ManagingPaymentMethodsContext implements Context
$this->iBrowsePaymentMethods();
Assert::true(
$this->indexPage->isResourceOnPage([$element => $code]),
$this->indexPage->isSingleResourceOnPage([$element => $code]),
sprintf('Payment method with %s %s cannot be found.', $element, $code)
);
}

View file

@ -120,7 +120,7 @@ final class ManagingPromotionsContext implements Context
$this->indexPage->open();
Assert::true(
$this->indexPage->isResourceOnPage(['name' => $promotionName]),
$this->indexPage->isSingleResourceOnPage(['name' => $promotionName]),
sprintf('Promotion with name %s has not been found.', $promotionName)
);
}
@ -212,7 +212,7 @@ final class ManagingPromotionsContext implements Context
$this->indexPage->open();
Assert::false(
$this->indexPage->isResourceOnPage([$element => $name]),
$this->indexPage->isSingleResourceOnPage([$element => $name]),
sprintf('Promotion with %s "%s" has been created, but it should not.', $element, $name)
);
}
@ -225,7 +225,7 @@ final class ManagingPromotionsContext implements Context
$this->indexPage->open();
Assert::true(
$this->indexPage->isResourceOnPage([$element => $value]),
$this->indexPage->isSingleResourceOnPage([$element => $value]),
sprintf('Promotion with %s "%s" cannot be found.', $element, $value)
);
}
@ -377,7 +377,7 @@ final class ManagingPromotionsContext implements Context
$this->indexPage->open();
Assert::false(
$this->indexPage->isResourceOnPage(['code' => $promotion->getCode()]),
$this->indexPage->isSingleResourceOnPage(['code' => $promotion->getCode()]),
sprintf('Promotion with code %s exists but should not.', $promotion->getCode())
);
}

View file

@ -161,7 +161,7 @@ final class ManagingShippingMethodsContext implements Context
$this->iWantToBrowseShippingMethods();
Assert::true(
$this->indexPage->isResourceOnPage(['name' => $shipmentMethodName]),
$this->indexPage->isSingleResourceOnPage(['name' => $shipmentMethodName]),
sprintf('The shipping method with name %s has not been found.', $shipmentMethodName)
);
}
@ -193,7 +193,7 @@ final class ManagingShippingMethodsContext implements Context
$this->iWantToBrowseShippingMethods();
Assert::true(
$this->indexPage->isResourceOnPage([$element => $code]),
$this->indexPage->isSingleResourceOnPage([$element => $code]),
sprintf('Shipping method with %s %s cannot be founded.', $element, $code)
);
}
@ -227,7 +227,7 @@ final class ManagingShippingMethodsContext implements Context
$this->iWantToBrowseShippingMethods();
Assert::true(
$this->indexPage->isResourceOnPage(
$this->indexPage->isSingleResourceOnPage(
[
'code' => $shippingMethod->getCode(),
'name' => $shippingMethodName,
@ -270,7 +270,7 @@ final class ManagingShippingMethodsContext implements Context
$this->iWantToBrowseShippingMethods();
Assert::false(
$this->indexPage->isResourceOnPage([$element => $name]),
$this->indexPage->isSingleResourceOnPage([$element => $name]),
sprintf('Shipping method with %s %s was created, but it should not.', $element, $name)
);
}
@ -383,7 +383,7 @@ final class ManagingShippingMethodsContext implements Context
public function thisShippingMethodShouldNoLongerExistInTheRegistry(ShippingMethodInterface $shippingMethod)
{
Assert::false(
$this->indexPage->isResourceOnPage(['code' => $shippingMethod->getCode()]),
$this->indexPage->isSingleResourceOnPage(['code' => $shippingMethod->getCode()]),
sprintf('Shipping method with code %s exists but should not.', $shippingMethod->getCode())
);
}
@ -427,7 +427,7 @@ final class ManagingShippingMethodsContext implements Context
$this->iWantToBrowseShippingMethods();
Assert::true(
$this->indexPage->isResourceOnPage(
$this->indexPage->isSingleResourceOnPage(
[
'name' => $shippingMethod->getName(),
'enabled' => $state,

View file

@ -88,7 +88,7 @@ final class ManagingTaxCategoriesContext implements Context
public function thisTaxCategoryShouldNoLongerExistInTheRegistry(TaxCategoryInterface $taxCategory)
{
Assert::false(
$this->indexPage->isResourceOnPage(['code' => $taxCategory->getCode()]),
$this->indexPage->isSingleResourceOnPage(['code' => $taxCategory->getCode()]),
sprintf('Tax category with code %s exists but should not.', $taxCategory->getCode())
);
}
@ -145,7 +145,7 @@ final class ManagingTaxCategoriesContext implements Context
{
$this->indexPage->open();
Assert::true(
$this->indexPage->isResourceOnPage(['name' => $taxCategoryName]),
$this->indexPage->isSingleResourceOnPage(['name' => $taxCategoryName]),
sprintf('Tax category with name %s has not been found.', $taxCategoryName)
);
}
@ -211,7 +211,7 @@ final class ManagingTaxCategoriesContext implements Context
{
$this->indexPage->open();
Assert::true(
$this->indexPage->isResourceOnPage(['code' => $taxCategory->getCode(), 'name' => $taxCategoryName]),
$this->indexPage->isSingleResourceOnPage(['code' => $taxCategory->getCode(), 'name' => $taxCategoryName]),
sprintf('Tax category name %s was not assigned properly.', $taxCategoryName)
);
}
@ -234,7 +234,7 @@ final class ManagingTaxCategoriesContext implements Context
{
$this->indexPage->open();
Assert::true(
$this->indexPage->isResourceOnPage([$element => $code]),
$this->indexPage->isSingleResourceOnPage([$element => $code]),
sprintf('Tax category with %s %s cannot be founded.', $element, $code)
);
}
@ -259,7 +259,7 @@ final class ManagingTaxCategoriesContext implements Context
{
$this->indexPage->open();
Assert::false(
$this->indexPage->isResourceOnPage([$element => $name]),
$this->indexPage->isSingleResourceOnPage([$element => $name]),
sprintf('Tax category with %s %s was created, but it should not.', $element, $name)
);
}

View file

@ -155,7 +155,7 @@ final class ManagingTaxRateContext implements Context
$this->indexPage->open();
Assert::true(
$this->indexPage->isResourceOnPage(['name' => $taxRateName]),
$this->indexPage->isSingleResourceOnPage(['name' => $taxRateName]),
sprintf('Tax rate with name %s has not been found.', $taxRateName)
);
}
@ -183,7 +183,7 @@ final class ManagingTaxRateContext implements Context
public function thisTaxRateShouldNoLongerExistInTheRegistry(TaxRateInterface $taxRate)
{
Assert::false(
$this->indexPage->isResourceOnPage(['code' => $taxRate->getCode()]),
$this->indexPage->isSingleResourceOnPage(['code' => $taxRate->getCode()]),
sprintf('Tax rate with code %s exists but should not.', $taxRate->getCode())
);
}
@ -270,7 +270,7 @@ final class ManagingTaxRateContext implements Context
$this->indexPage->open();
Assert::true(
$this->indexPage->isResourceOnPage([$element => $code]),
$this->indexPage->isSingleResourceOnPage([$element => $code]),
sprintf('Tax rate with %s %s cannot be founded.', $element, $code)
);
}
@ -315,7 +315,7 @@ final class ManagingTaxRateContext implements Context
$this->indexPage->open();
Assert::false(
$this->indexPage->isResourceOnPage([$element => $name]),
$this->indexPage->isSingleResourceOnPage([$element => $name]),
sprintf('Tax rate with %s %s was created, but it should not.', $element, $name)
);
}
@ -346,7 +346,7 @@ final class ManagingTaxRateContext implements Context
$this->indexPage->open();
Assert::true(
$this->indexPage->isResourceOnPage(
$this->indexPage->isSingleResourceOnPage(
[
'code' => $taxRate->getCode(),
$element => $taxRateElement,

View file

@ -279,7 +279,7 @@ final class ManagingZonesContext implements Context
$this->indexPage->open();
Assert::true(
$this->indexPage->isResourceOnPage(['code' => $code]),
$this->indexPage->isSingleResourceOnPage(['code' => $code]),
sprintf('Zone with code %s cannot be found.', $code)
);
}
@ -305,7 +305,7 @@ final class ManagingZonesContext implements Context
$this->indexPage->open();
Assert::false(
$this->indexPage->isResourceOnPage([$element => $value]),
$this->indexPage->isSingleResourceOnPage([$element => $value]),
sprintf('Zone with %s %s was added, but it should not.', $element, $value)
);
}
@ -349,7 +349,7 @@ final class ManagingZonesContext implements Context
public function thisZoneShouldNoLongerExistInTheRegistry($zoneName)
{
Assert::false(
$this->indexPage->isResourceOnPage(['name' => $zoneName]),
$this->indexPage->isSingleResourceOnPage(['name' => $zoneName]),
sprintf('Zone named %s should no longer exist', $zoneName)
);
}
@ -374,7 +374,7 @@ final class ManagingZonesContext implements Context
public function iShouldSeeTheZoneNamedInTheList(ZoneInterface $zone)
{
Assert::true(
$this->indexPage->isResourceOnPage(['code' => $zone->getCode(), 'name' => $zone->getName()]),
$this->indexPage->isSingleResourceOnPage(['code' => $zone->getCode(), 'name' => $zone->getName()]),
sprintf('Zone named %s should exist in the registry', $zone->getName())
);
}

View file

@ -55,7 +55,7 @@ class IndexPage extends SymfonyPage implements IndexPageInterface
/**
* {@inheritdoc}
*/
public function isResourceOnPage(array $parameters)
public function isSingleResourceOnPage(array $parameters)
{
try {
$rows = $this->tableAccessor->getRowsWithFields($this->getElement('table'), $parameters);

View file

@ -23,7 +23,7 @@ interface IndexPageInterface extends PageInterface
*
* @return bool
*/
public function isResourceOnPage(array $parameters);
public function isSingleResourceOnPage(array $parameters);
/**
* @param array $parameters