mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 09:02:12 +00:00
Add "akeneo/phpspec-skip-example-extension" dependency & fix broken specs
This commit is contained in:
parent
7dcbc9810d
commit
24f7ddf35f
10 changed files with 545 additions and 577 deletions
|
|
@ -73,8 +73,7 @@
|
|||
"twig/twig": "~1.11",
|
||||
"white-october/pagerfanta-bundle": "~1.0",
|
||||
"willdurand/hateoas-bundle": "~0.4",
|
||||
"winzou/state-machine-bundle": "~0.2",
|
||||
"akeneo/phpspec-skip-example-extension": "^1.2"
|
||||
"winzou/state-machine-bundle": "~0.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"behat/behat": "~3.0",
|
||||
|
|
@ -86,7 +85,8 @@
|
|||
"coduo/php-matcher": "~1.0",
|
||||
"phpspec/phpspec": "~2.1",
|
||||
"phpunit/phpunit": "~4.1",
|
||||
"lakion/mink-debug-extension": "^1.0.1"
|
||||
"lakion/mink-debug-extension": "^1.0.1",
|
||||
"akeneo/phpspec-skip-example-extension": "~1.2"
|
||||
},
|
||||
"replace": {
|
||||
"sylius/addressing": "self.version",
|
||||
|
|
|
|||
996
composer.lock
generated
996
composer.lock
generated
File diff suppressed because it is too large
Load diff
25
phpspec.yml
25
phpspec.yml
|
|
@ -1,51 +1,49 @@
|
|||
suites:
|
||||
Addressing : { namespace: Sylius\Component\Addressing, psr4_prefix: Sylius\Component\Addressing, spec_path: src/Sylius/Component/Addressing, src_path: src/Sylius/Component/Addressing }
|
||||
Attribute : { namespace: Sylius\Component\Attribute, psr4_prefix: Sylius\Component\Attribute, spec_path: src/Sylius/Component/Attribute, src_path: src/Sylius/Component/Attribute }
|
||||
Archetype : { namespace: Sylius\Component\Archetype, psr4_prefix: Sylius\Component\Archetype, spec_path: src/Sylius/Component/Archetype, src_path: src/Sylius/Component/Archetype }
|
||||
Attribute : { namespace: Sylius\Component\Attribute, psr4_prefix: Sylius\Component\Attribute, spec_path: src/Sylius/Component/Attribute, src_path: src/Sylius/Component/Attribute }
|
||||
Cart : { namespace: Sylius\Component\Cart, psr4_prefix: Sylius\Component\Cart, spec_path: src/Sylius/Component/Cart, src_path: src/Sylius/Component/Cart }
|
||||
Channel : { namespace: Sylius\Component\Channel, psr4_prefix: Sylius\Component\Channel, spec_path: src/Sylius/Component/Channel, src_path: src/Sylius/Component/Channel }
|
||||
Core : { namespace: Sylius\Component\Core, psr4_prefix: Sylius\Component\Core, spec_path: src/Sylius/Component/Core, src_path: src/Sylius/Component/Core }
|
||||
Contact : { namespace: Sylius\Component\Contact, psr4_prefix: Sylius\Component\Contact, spec_path: src/Sylius/Component/Contact, src_path: src/Sylius/Component/Contact }
|
||||
Core : { namespace: Sylius\Component\Core, psr4_prefix: Sylius\Component\Core, spec_path: src/Sylius/Component/Core, src_path: src/Sylius/Component/Core }
|
||||
Currency : { namespace: Sylius\Component\Currency, psr4_prefix: Sylius\Component\Currency, spec_path: src/Sylius/Component/Currency, src_path: src/Sylius/Component/Currency }
|
||||
Installer : { namespace: Sylius\Component\Installer, psr4_prefix: Sylius\Component\Installer, spec_path: src/Sylius/Component/Installer, src_path: src/Sylius/Component/Installer }
|
||||
Inventory : { namespace: Sylius\Component\Inventory, psr4_prefix: Sylius\Component\Inventory, spec_path: src/Sylius/Component/Inventory, src_path: src/Sylius/Component/Inventory }
|
||||
Locale : { namespace: Sylius\Component\Locale, psr4_prefix: Sylius\Component\Locale, spec_path: src/Sylius/Component/Locale, src_path: src/Sylius/Component/Locale }
|
||||
Mailer : { namespace: Sylius\Component\Mailer, psr4_prefix: Sylius\Component\Mailer, spec_path: src/Sylius/Component/Mailer, src_path: src/Sylius/Component/Mailer }
|
||||
Order : { namespace: Sylius\Component\Order, psr4_prefix: Sylius\Component\Order, spec_path: src/Sylius/Component/Order, src_path: src/Sylius/Component/Order }
|
||||
Originator : { namespace: Sylius\Component\Originator, psr4_prefix: Sylius\Component\Originator, spec_path: src/Sylius/Component/Originator, src_path: src/Sylius/Component/Originator }
|
||||
Payment : { namespace: Sylius\Component\Payment, psr4_prefix: Sylius\Component\Payment , spec_path: src/Sylius/Component/Payment, src_path: src/Sylius/Component/Payment }
|
||||
Payum : { namespace: Sylius\Component\Payum, psr4_prefix: Sylius\Component\Payum, spec_path: src/Sylius/Component/Payum, src_path: src/Sylius/Component/Payum }
|
||||
Pricing : { namespace: Sylius\Component\Pricing, psr4_prefix: Sylius\Component\Pricing , spec_path: src/Sylius/Component/Pricing, src_path: src/Sylius/Component/Pricing }
|
||||
Product : { namespace: Sylius\Component\Product, psr4_prefix: Sylius\Component\Product , spec_path: src/Sylius/Component/Product, src_path: src/Sylius/Component/Product }
|
||||
Promotion : { namespace: Sylius\Component\Promotion, psr4_prefix: Sylius\Component\Promotion, spec_path: src/Sylius/Component/Promotion, src_path: src/Sylius/Component/Promotion }
|
||||
Rbac : { namespace: Sylius\Component\Rbac, psr4_prefix: Sylius\Component\Rbac, spec_path: src/Sylius/Component/Rbac, src_path: src/Sylius/Component/Rbac }
|
||||
Registry : { namespace: Sylius\Component\Registry, psr4_prefix: Sylius\Component\Registry, spec_path: src/Sylius/Component/Registry, src_path: src/Sylius/Component/Registry }
|
||||
Report : { namespace: Sylius\Component\Report, psr4_prefix: Sylius\Component\Report , spec_path: src/Sylius/Component/Report, src_path: src/Sylius/Component/Report }
|
||||
Resource : { namespace: Sylius\Component\Resource, psr4_prefix: Sylius\Component\Resource, spec_path: src/Sylius/Component/Resource, src_path: src/Sylius/Component/Resource }
|
||||
Sequence : { namespace: Sylius\Component\Sequence, psr4_prefix: Sylius\Component\Sequence, spec_path: src/Sylius/Component/Sequence, src_path: src/Sylius/Component/Sequence }
|
||||
Settings : { namespace: Sylius\Component\Settings, psr4_prefix: Sylius\Component\Settings, spec_path: src/Sylius/Component/Settings, src_path: src/Sylius/Component/Settings }
|
||||
Shipping : { namespace: Sylius\Component\Shipping, psr4_prefix: Sylius\Component\Shipping, spec_path: src/Sylius/Component/Shipping, src_path: src/Sylius/Component/Shipping }
|
||||
Storage : { namespace: Sylius\Component\Storage, psr4_prefix: Sylius\Component\Storage , spec_path: src/Sylius/Component/Storage, src_path: src/Sylius/Component/Storage }
|
||||
Taxation : { namespace: Sylius\Component\Taxation, psr4_prefix: Sylius\Component\Taxation, spec_path: src/Sylius/Component/Taxation, src_path: src/Sylius/Component/Taxation }
|
||||
Taxonomy : { namespace: Sylius\Component\Taxonomy, psr4_prefix: Sylius\Component\Taxonomy, spec_path: src/Sylius/Component/Taxonomy, src_path: src/Sylius/Component/Taxonomy }
|
||||
Translation : { namespace: Sylius\Component\Translation, psr4_prefix: Sylius\Component\Translation, spec_path: src/Sylius/Component/Translation, src_path: src/Sylius/Component/Translation }
|
||||
Variation : { namespace: Sylius\Component\Variation, psr4_prefix: Sylius\Component\Variation, spec_path: src/Sylius/Component/Variation, src_path: src/Sylius/Component/Variation }
|
||||
Mailer : { namespace: Sylius\Component\Mailer, psr4_prefix: Sylius\Component\Mailer, spec_path: src/Sylius/Component/Mailer, src_path: src/Sylius/Component/Mailer }
|
||||
Rbac : { namespace: Sylius\Component\Rbac, psr4_prefix: Sylius\Component\Rbac, spec_path: src/Sylius/Component/Rbac, src_path: src/Sylius/Component/Rbac }
|
||||
User : { namespace: Sylius\Component\User, psr4_prefix: Sylius\Component\User, spec_path: src/Sylius/Component/User, src_path: src/Sylius/Component/User }
|
||||
Variation : { namespace: Sylius\Component\Variation, psr4_prefix: Sylius\Component\Variation, spec_path: src/Sylius/Component/Variation, src_path: src/Sylius/Component/Variation }
|
||||
|
||||
AddressingBundle : { namespace: Sylius\Bundle\AddressingBundle, psr4_prefix: Sylius\Bundle\AddressingBundle, spec_path: src/Sylius/Bundle/AddressingBundle, src_path: src/Sylius/Bundle/AddressingBundle }
|
||||
ApiBundle : { namespace: Sylius\Bundle\ApiBundle, psr4_prefix: Sylius\Bundle\ApiBundle, spec_path: src/Sylius/Bundle/ApiBundle, src_path: src/Sylius/Bundle/ApiBundle }
|
||||
AttributeBundle : { namespace: Sylius\Bundle\AttributeBundle, psr4_prefix: Sylius\Bundle\AttributeBundle, spec_path: src/Sylius/Bundle/AttributeBundle, src_path: src/Sylius/Bundle/AttributeBundle }
|
||||
ArchetypeBundle : { namespace: Sylius\Bundle\ArchetypeBundle, psr4_prefix: Sylius\Bundle\ArchetypeBundle, spec_path: src/Sylius/Bundle/ArchetypeBundle, src_path: src/Sylius/Bundle/ArchetypeBundle }
|
||||
AttributeBundle : { namespace: Sylius\Bundle\AttributeBundle, psr4_prefix: Sylius\Bundle\AttributeBundle, spec_path: src/Sylius/Bundle/AttributeBundle, src_path: src/Sylius/Bundle/AttributeBundle }
|
||||
CartBundle : { namespace: Sylius\Bundle\CartBundle, psr4_prefix: Sylius\Bundle\CartBundle, spec_path: src/Sylius/Bundle/CartBundle, src_path: src/Sylius/Bundle/CartBundle }
|
||||
ContentBundle : { namespace: Sylius\Bundle\ContentBundle, psr4_prefix: Sylius\Bundle\ContentBundle, spec_path: src/Sylius/Bundle/ContentBundle, src_path: src/Sylius/Bundle/ContentBundle }
|
||||
ChannelBundle : { namespace: Sylius\Bundle\ChannelBundle, psr4_prefix: Sylius\Bundle\ChannelBundle, spec_path: src/Sylius/Bundle/ChannelBundle, src_path: src/Sylius/Bundle/ChannelBundle }
|
||||
ContactBundle : { namespace: Sylius\Bundle\ContactBundle, psr4_prefix: Sylius\Bundle\ContactBundle, spec_path: src/Sylius/Bundle/ContactBundle, src_path: src/Sylius/Bundle/ContactBundle }
|
||||
ContentBundle : { namespace: Sylius\Bundle\ContentBundle, psr4_prefix: Sylius\Bundle\ContentBundle, spec_path: src/Sylius/Bundle/ContentBundle, src_path: src/Sylius/Bundle/ContentBundle }
|
||||
CoreBundle : { namespace: Sylius\Bundle\CoreBundle, psr4_prefix: Sylius\Bundle\CoreBundle, spec_path: src/Sylius/Bundle/CoreBundle, src_path: src/Sylius/Bundle/CoreBundle }
|
||||
CurrencyBundle : { namespace: Sylius\Bundle\CurrencyBundle, psr4_prefix: Sylius\Bundle\CurrencyBundle , spec_path: src/Sylius/Bundle/CurrencyBundle, src_path: src/Sylius/Bundle/CurrencyBundle }
|
||||
ContactBundle : { namespace: Sylius\Bundle\ContactBundle, psr4_prefix: Sylius\Bundle\ContactBundle, spec_path: src/Sylius/Bundle/ContactBundle, src_path: src/Sylius/Bundle/ContactBundle }
|
||||
FlowBundle : { namespace: Sylius\Bundle\FlowBundle, psr4_prefix: Sylius\Bundle\FlowBundle, spec_path: src/Sylius/Bundle/FlowBundle, src_path: src/Sylius/Bundle/FlowBundle }
|
||||
InstallerBundle : { namespace: Sylius\Bundle\InstallerBundle, psr4_prefix: Sylius\Bundle\InstallerBundle, spec_path: src/Sylius/Bundle/InstallerBundle, src_path: src/Sylius/Bundle/InstallerBundle }
|
||||
InventoryBundle : { namespace: Sylius\Bundle\InventoryBundle, psr4_prefix: Sylius\Bundle\InventoryBundle, spec_path: src/Sylius/Bundle/InventoryBundle, src_path: src/Sylius/Bundle/InventoryBundle }
|
||||
LocaleBundle : { namespace: Sylius\Bundle\LocaleBundle, psr4_prefix: Sylius\Bundle\LocaleBundle, spec_path: src/Sylius/Bundle/LocaleBundle, src_path: src/Sylius/Bundle/LocaleBundle }
|
||||
MailerBundle : { namespace: Sylius\Bundle\MailerBundle, psr4_prefix: Sylius\Bundle\MailerBundle, spec_path: src/Sylius/Bundle/MailerBundle, src_path: src/Sylius/Bundle/MailerBundle }
|
||||
MoneyBundle : { namespace: Sylius\Bundle\MoneyBundle, psr4_prefix: Sylius\Bundle\MoneyBundle, spec_path: src/Sylius/Bundle/MoneyBundle, src_path: src/Sylius/Bundle/MoneyBundle }
|
||||
OrderBundle : { namespace: Sylius\Bundle\OrderBundle, psr4_prefix: Sylius\Bundle\OrderBundle, spec_path: src/Sylius/Bundle/OrderBundle, src_path: src/Sylius/Bundle/OrderBundle }
|
||||
PaymentBundle : { namespace: Sylius\Bundle\PaymentBundle, psr4_prefix: Sylius\Bundle\PaymentBundle, spec_path: src/Sylius/Bundle/PaymentBundle, src_path: src/Sylius/Bundle/PaymentBundle }
|
||||
|
|
@ -53,8 +51,9 @@ suites:
|
|||
PricingBundle : { namespace: Sylius\Bundle\PricingBundle, psr4_prefix: Sylius\Bundle\PricingBundle, spec_path: src/Sylius/Bundle/PricingBundle, src_path: src/Sylius/Bundle/PricingBundle }
|
||||
ProductBundle : { namespace: Sylius\Bundle\ProductBundle, psr4_prefix: Sylius\Bundle\ProductBundle, spec_path: src/Sylius/Bundle/ProductBundle, src_path: src/Sylius/Bundle/ProductBundle }
|
||||
PromotionBundle : { namespace: Sylius\Bundle\PromotionBundle, psr4_prefix: Sylius\Bundle\PromotionBundle, spec_path: src/Sylius/Bundle/PromotionBundle, src_path: src/Sylius/Bundle/PromotionBundle }
|
||||
ResourceBundle : { namespace: Sylius\Bundle\ResourceBundle, psr4_prefix: Sylius\Bundle\ResourceBundle , spec_path: src/Sylius/Bundle/ResourceBundle, src_path: src/Sylius/Bundle/ResourceBundle, src_path: src/Sylius/Bundle/ResourceBundle, src_path: src/Sylius/Bundle/ResourceBundle }
|
||||
RbacBundle : { namespace: Sylius\Bundle\RbacBundle, psr4_prefix: Sylius\Bundle\RbacBundle, spec_path: src/Sylius/Bundle/RbacBundle, src_path: src/Sylius/Bundle/RbacBundle }
|
||||
ReportBundle : { namespace: Sylius\Bundle\ReportBundle, psr4_prefix: Sylius\Bundle\ReportBundle , spec_path: src/Sylius/Bundle/ReportBundle, src_path: src/Sylius/Bundle/ReportBundle }
|
||||
ResourceBundle : { namespace: Sylius\Bundle\ResourceBundle, psr4_prefix: Sylius\Bundle\ResourceBundle , spec_path: src/Sylius/Bundle/ResourceBundle, src_path: src/Sylius/Bundle/ResourceBundle }
|
||||
SearchBundle : { namespace: Sylius\Bundle\SearchBundle, psr4_prefix: Sylius\Bundle\SearchBundle, spec_path: src/Sylius/Bundle/SearchBundle, src_path: src/Sylius/Bundle/SearchBundle }
|
||||
SequenceBundle : { namespace: Sylius\Bundle\SequenceBundle, psr4_prefix: Sylius\Bundle\SequenceBundle , spec_path: src/Sylius/Bundle/SequenceBundle, src_path: src/Sylius/Bundle/SequenceBundle }
|
||||
SettingsBundle : { namespace: Sylius\Bundle\SettingsBundle, psr4_prefix: Sylius\Bundle\SettingsBundle , spec_path: src/Sylius/Bundle/SettingsBundle, src_path: src/Sylius/Bundle/SettingsBundle }
|
||||
|
|
@ -63,8 +62,6 @@ suites:
|
|||
TaxonomyBundle : { namespace: Sylius\Bundle\TaxonomyBundle, psr4_prefix: Sylius\Bundle\TaxonomyBundle , spec_path: src/Sylius/Bundle/TaxonomyBundle, src_path: src/Sylius/Bundle/TaxonomyBundle }
|
||||
TranslationBundle : { namespace: Sylius\Bundle\TranslationBundle, psr4_prefix: Sylius\Bundle\TranslationBundle , spec_path: src/Sylius/Bundle/TranslationBundle, src_path: src/Sylius/Bundle/TranslationBundle }
|
||||
VariationBundle : { namespace: Sylius\Bundle\VariationBundle, psr4_prefix: Sylius\Bundle\VariationBundle, spec_path: src/Sylius/Bundle/VariationBundle, src_path: src/Sylius/Bundle/VariationBundle }
|
||||
MailerBundle : { namespace: Sylius\Bundle\MailerBundle, psr4_prefix: Sylius\Bundle\MailerBundle, spec_path: src/Sylius/Bundle/MailerBundle, src_path: src/Sylius/Bundle/MailerBundle }
|
||||
RbacBundle : { namespace: Sylius\Bundle\RbacBundle, psr4_prefix: Sylius\Bundle\RbacBundle, spec_path: src/Sylius/Bundle/RbacBundle, src_path: src/Sylius/Bundle/RbacBundle }
|
||||
UserBundle : { namespace: Sylius\Bundle\UserBundle, psr4_prefix: Sylius\Bundle\UserBundle, spec_path: src/Sylius/Bundle/UserBundle, src_path: src/Sylius/Bundle/UserBundle }
|
||||
|
||||
extensions:
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ class MoneyHelperSpec extends ObjectBehavior
|
|||
{
|
||||
function let()
|
||||
{
|
||||
$this->beConstructedWith('de_DE', 'EUR');
|
||||
$this->beConstructedWith('en', 'EUR');
|
||||
}
|
||||
|
||||
function it_is_initializable()
|
||||
|
|
@ -35,17 +35,17 @@ class MoneyHelperSpec extends ObjectBehavior
|
|||
|
||||
function it_formats_the_integer_amounts_into_string_representation()
|
||||
{
|
||||
$this->formatAmount(15)->shouldReturn('0,15 €');
|
||||
$this->formatAmount(2500)->shouldReturn('25,00 €');
|
||||
$this->formatAmount(312)->shouldReturn('3,12 €');
|
||||
$this->formatAmount(500)->shouldReturn('5,00 €');
|
||||
$this->formatAmount(15)->shouldReturn('€0.15');
|
||||
$this->formatAmount(2500)->shouldReturn('€25.00');
|
||||
$this->formatAmount(312)->shouldReturn('€3.12');
|
||||
$this->formatAmount(500)->shouldReturn('€5.00');
|
||||
}
|
||||
|
||||
function it_allows_to_format_money_in_different_currencies()
|
||||
{
|
||||
$this->formatAmount(15, 'USD')->shouldReturn('0,15 $');
|
||||
$this->formatAmount(2500, 'USD')->shouldReturn('25,00 $');
|
||||
$this->formatAmount(312, 'EUR')->shouldReturn('3,12 €');
|
||||
$this->formatAmount(500)->shouldReturn('5,00 €');
|
||||
$this->formatAmount(15, 'USD')->shouldReturn('$0.15');
|
||||
$this->formatAmount(2500, 'USD')->shouldReturn('$25.00');
|
||||
$this->formatAmount(312, 'EUR')->shouldReturn('€3.12');
|
||||
$this->formatAmount(500)->shouldReturn('€5.00');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.9",
|
||||
"php": ">=5.5.9",
|
||||
|
||||
"symfony/framework-bundle": "~2.3",
|
||||
"symfony/twig-bundle": "~2.3",
|
||||
|
|
@ -41,7 +41,8 @@
|
|||
"doctrine/mongodb-odm": "1.0.*@dev",
|
||||
"doctrine/phpcr-bundle": "~1.1",
|
||||
"sylius/rbac-bundle": "0.16.*",
|
||||
"sylius/translation-bundle": "0.16.*"
|
||||
"sylius/translation-bundle": "0.16.*",
|
||||
"akeneo/phpspec-skip-example-extension": "~1.2"
|
||||
},
|
||||
"suggest": {
|
||||
"doctrine/orm": "~2.4",
|
||||
|
|
|
|||
|
|
@ -3,3 +3,6 @@ suites:
|
|||
namespace: Sylius\Bundle\ResourceBundle
|
||||
psr4_prefix: Sylius\Bundle\ResourceBundle
|
||||
src_path: .
|
||||
|
||||
extensions:
|
||||
- Akeneo\SkipExampleExtension
|
||||
|
|
|
|||
|
|
@ -18,9 +18,7 @@ use Doctrine\ODM\MongoDB\UnitOfWork;
|
|||
use PhpSpec\ObjectBehavior;
|
||||
|
||||
/**
|
||||
* Doctrine ODM driver document repository spec.
|
||||
*
|
||||
* @require \Doctrine\ODM\MongoDB\DocumentManager
|
||||
* @require Doctrine\ODM\MongoDB\DocumentManager
|
||||
*
|
||||
* @author Saša Stamenković <umpirsky@gmail.com>
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -31,7 +31,8 @@
|
|||
"phpspec/phpspec": "~2.1",
|
||||
"doctrine/orm": "~2.2",
|
||||
"symfony/form": "~2.3",
|
||||
"symfony/validator": "~2.3"
|
||||
"symfony/validator": "~2.3",
|
||||
"akeneo/phpspec-skip-example-extension": "~1.2"
|
||||
},
|
||||
"config": {
|
||||
"bin-dir": "bin"
|
||||
|
|
|
|||
|
|
@ -3,3 +3,6 @@ suites:
|
|||
namespace: Sylius\Bundle\TranslationBundle
|
||||
psr4_prefix: Sylius\Bundle\TranslationBundle
|
||||
src_path: .
|
||||
|
||||
extensions:
|
||||
- Akeneo\SkipExampleExtension
|
||||
|
|
|
|||
|
|
@ -23,9 +23,7 @@ use Sylius\Component\Translation\Provider\LocaleProviderInterface;
|
|||
require_once __DIR__.'/../../../../../ResourceBundle/spec/Fixture/Document/TranslatableFoo.php';
|
||||
|
||||
/**
|
||||
* Doctrine ODM MongoDB driver translatable document repository spec.
|
||||
*
|
||||
* @require \Doctrine\ODM\MongoDB\DocumentManager
|
||||
* @require Doctrine\ODM\MongoDB\DocumentManager
|
||||
*
|
||||
* @author Ivannis Suárez Jérez <ivannis.suarez@gmail.com>
|
||||
*/
|
||||
|
|
@ -40,15 +38,9 @@ class TranslatableResourceRepositorySpec extends ObjectBehavior
|
|||
) {
|
||||
$class->name = 'spec\Sylius\Bundle\ResourceBundle\Fixture\Document\TranslatableFoo';
|
||||
|
||||
$documentManager
|
||||
->createQueryBuilder($class->name)
|
||||
->willReturn($queryBuilder)
|
||||
;
|
||||
$documentManager->createQueryBuilder($class->name)->willReturn($queryBuilder);
|
||||
|
||||
$queryBuilder
|
||||
->getQuery()
|
||||
->willReturn($query)
|
||||
;
|
||||
$queryBuilder->getQuery()->willReturn($query);
|
||||
|
||||
$this->beConstructedWith($documentManager, $unitOfWork, $class);
|
||||
}
|
||||
|
|
@ -90,20 +82,12 @@ class TranslatableResourceRepositorySpec extends ObjectBehavior
|
|||
|
||||
foreach ($criteria as $property => $value) {
|
||||
if (in_array($property, $translatableFields)) {
|
||||
$property = 'translations.en_US.' . $property;
|
||||
$property = 'translations.en_US.'.$property;
|
||||
}
|
||||
|
||||
$queryBuilder
|
||||
->field($property)
|
||||
->shouldBeCalled()
|
||||
->willReturn($queryBuilder)
|
||||
;
|
||||
$queryBuilder->field($property)->willReturn($queryBuilder);
|
||||
|
||||
$queryBuilder
|
||||
->equals($value)
|
||||
->shouldBeCalled()
|
||||
->willReturn($queryBuilder)
|
||||
;
|
||||
$queryBuilder->equals($value)->willReturn($queryBuilder);
|
||||
}
|
||||
|
||||
$this->findOneBy($criteria)->shouldReturn(null);
|
||||
|
|
@ -125,20 +109,12 @@ class TranslatableResourceRepositorySpec extends ObjectBehavior
|
|||
|
||||
foreach ($criteria as $property => $value) {
|
||||
if (in_array($property, $translatableFields)) {
|
||||
$property = 'translations.en_US.' . $property;
|
||||
$property = 'translations.en_US.'.$property;
|
||||
}
|
||||
|
||||
$queryBuilder
|
||||
->field($property)
|
||||
->shouldBeCalled()
|
||||
->willReturn($queryBuilder)
|
||||
;
|
||||
$queryBuilder->field($property)->willReturn($queryBuilder);
|
||||
|
||||
$queryBuilder
|
||||
->equals($value)
|
||||
->shouldBeCalled()
|
||||
->willReturn($queryBuilder)
|
||||
;
|
||||
$queryBuilder->equals($value)->willReturn($queryBuilder);
|
||||
}
|
||||
|
||||
$this->findBy($criteria)->shouldReturn(null);
|
||||
|
|
@ -158,17 +134,9 @@ class TranslatableResourceRepositorySpec extends ObjectBehavior
|
|||
);
|
||||
|
||||
foreach ($criteria as $property => $value) {
|
||||
$queryBuilder
|
||||
->field($property)
|
||||
->shouldBeCalled()
|
||||
->willReturn($queryBuilder)
|
||||
;
|
||||
$queryBuilder->field($property)->willReturn($queryBuilder);
|
||||
|
||||
$queryBuilder
|
||||
->in($value)
|
||||
->shouldBeCalled()
|
||||
->willReturn($queryBuilder)
|
||||
;
|
||||
$queryBuilder->in($value)->willReturn($queryBuilder);
|
||||
}
|
||||
|
||||
$this->findBy($criteria)->shouldReturn(null);
|
||||
|
|
@ -181,9 +149,6 @@ class TranslatableResourceRepositorySpec extends ObjectBehavior
|
|||
|
||||
function it_creates_Pagerfanta_paginator()
|
||||
{
|
||||
$this
|
||||
->createPaginator()
|
||||
->shouldHaveType('Pagerfanta\Pagerfanta')
|
||||
;
|
||||
$this->createPaginator()->shouldHaveType('Pagerfanta\Pagerfanta');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue