/** * @return array */ protected function getExtensions() { $accountUserRoleSelectType = new EntitySelectTypeStub($this->getRoles(), AccountUserRoleSelectType::NAME, new AccountUserRoleSelectType()); $addressEntityType = new EntityType($this->getAddresses(), 'test_address_entity'); $accountSelectType = new AccountSelectTypeStub($this->getAccounts(), AccountSelectType::NAME); return [new PreloadedExtension([OroDateType::NAME => new OroDateType(), AccountUserRoleSelectType::NAME => $accountUserRoleSelectType, $accountSelectType->getName() => $accountSelectType, AddressCollectionTypeStub::NAME => new AddressCollectionTypeStub(), $addressEntityType->getName() => $addressEntityType], []), new ValidatorExtension(Validation::createValidator())]; }
/** * @return array */ protected function getExtensions() { $entityType = new EntityType([1 => $this->getProductEntityWithPrecision(1, 'kg', 3), 2 => $this->getProductEntityWithPrecision(2, 'kg', 3)]); $productUnitSelection = new EntityType($this->prepareProductUnitSelectionChoices(), ProductUnitSelectionType::NAME); $productSelectType = new ProductSelectTypeStub(); return [new PreloadedExtension([$entityType->getName() => $entityType, $productSelectType->getName() => $productSelectType, ProductUnitSelectionType::NAME => $productUnitSelection], [])]; }
/** * @return array */ protected function getExtensions() { $entityType = new EntityType([1 => $this->getEntity('OroB2B\\Bundle\\PricingBundle\\Entity\\PriceList', 1), 2 => $this->getEntity('OroB2B\\Bundle\\PricingBundle\\Entity\\PriceList', 2)]); $productUnitSelection = new EntityType($this->prepareProductUnitSelectionChoices(), ProductUnitSelectionType::NAME); $priceType = new PriceType(); $priceType->setDataClass('Oro\\Bundle\\CurrencyBundle\\Model\\Price'); return [new PreloadedExtension([$entityType->getName() => $entityType, PriceListSelectType::NAME => new PriceListSelectTypeStub(), ProductUnitSelectionType::NAME => $productUnitSelection, PriceType::NAME => $priceType, CurrencySelectionType::NAME => new CurrencySelectionTypeStub()], []), new ValidatorExtension(Validation::createValidator())]; }
/** * @return array */ protected function getExtensions() { $accountGroupSelectType = new EntityType([1 => $this->getEntity('OroB2B\\Bundle\\AccountBundle\\Entity\\AccountGroup', 1), 2 => $this->getEntity('OroB2B\\Bundle\\AccountBundle\\Entity\\AccountGroup', 2)], AccountGroupSelectType::NAME); $parentAccountSelectType = new EntityType([1 => $this->getEntity('OroB2B\\Bundle\\AccountBundle\\Entity\\Account', 1), 2 => $this->getEntity('OroB2B\\Bundle\\AccountBundle\\Entity\\Account', 2)], ParentAccountSelectType::NAME); $addressEntityType = new EntityType($this->getAddresses(), 'test_address_entity'); $internalRatingEnumSelect = new EnumSelectType([new StubEnumValue('1_of_5', '1 of 5'), new StubEnumValue('2_of_5', '2 of 5')]); return [new PreloadedExtension([AccountGroupSelectType::NAME => $accountGroupSelectType, ParentAccountSelectType::NAME => $parentAccountSelectType, 'oro_address_collection' => new AddressCollectionTypeStub(), $addressEntityType->getName() => $addressEntityType, EnumSelectType::NAME => $internalRatingEnumSelect], [])]; }
/** * @return array */ protected function getExtensions() { $unitSelectType = new EntityType(['kg' => $this->getEntity('OroB2B\\Bundle\\ProductBundle\\Entity\\ProductUnit', 'kg', 'code'), 'item' => $this->getEntity('OroB2B\\Bundle\\ProductBundle\\Entity\\ProductUnit', 'item', 'code')], ProductUnitSelectionType::NAME); $priceType = new PriceType(); $priceType->setDataClass('Oro\\Bundle\\CurrencyBundle\\Model\\Price'); $orderPriceType = new PriceTypeSelectorType(); $dateType = new OroDateType(); return [new PreloadedExtension([$unitSelectType->getName() => $unitSelectType, $priceType->getName() => $priceType, $orderPriceType->getName() => $orderPriceType, $dateType->getName() => $dateType], [])]; }
/** * @return array */ protected function getExtensions() { $account = $this->getAccount(1); $user = new AccountUser(); $user->setAccount($account); $this->securityFacade->expects($this->any())->method('getLoggedUser')->willReturn($user); $frontendUserRoleSelectType = new EntitySelectTypeStub($this->getRoles(), FrontendAccountUserRoleSelectType::NAME, new AccountUserRoleSelectType()); $addressEntityType = new EntityType($this->getAddresses(), 'test_address_entity'); $accountSelectType = new AccountSelectTypeStub($this->getAccounts(), 'orob2b_account_select'); $accountUserType = new AccountUserType($this->securityFacade); $accountUserType->setDataClass(self::DATA_CLASS); $accountUserType->setAddressClass(self::ADDRESS_CLASS); return [new PreloadedExtension([OroDateType::NAME => new OroDateType(), AccountUserType::NAME => $accountUserType, FrontendAccountUserRoleSelectType::NAME => $frontendUserRoleSelectType, $accountSelectType->getName() => $accountSelectType, AddressCollectionTypeStub::NAME => new AddressCollectionTypeStub(), $addressEntityType->getName() => $addressEntityType], []), new ValidatorExtension(Validation::createValidator())]; }
/** * @return array */ protected function getExtensions() { $entityType = new EntityType([1 => $this->getProductEntityWithPrecision(1, 'kg', 3), 2 => $this->getProductEntityWithPrecision(2, 'kg', 3)]); $productUnitSelection = new EntityType($this->prepareProductUnitSelectionChoices(), ProductUnitSelectionType::NAME); /** @var \PHPUnit_Framework_MockObject_MockObject|ConfigManager $configManager */ $configManager = $this->getMockBuilder('Oro\\Bundle\\ConfigBundle\\Config\\ConfigManager')->disableOriginalConstructor()->getMock(); $configManager->expects($this->any())->method('get')->with('oro_currency.allowed_currencies')->will($this->returnValue(['USD', 'EUR'])); /** @var \PHPUnit_Framework_MockObject_MockObject|LocaleSettings $localeSettings */ $localeSettings = $this->getMockBuilder('Oro\\Bundle\\LocaleBundle\\Model\\LocaleSettings')->disableOriginalConstructor()->getMock(); $productSelect = new ProductSelectTypeStub(); $priceType = new PriceType(); $priceType->setDataClass('Oro\\Bundle\\CurrencyBundle\\Model\\Price'); return [new PreloadedExtension([$entityType->getName() => $entityType, ProductSelectType::NAME => $productSelect, ProductUnitSelectionType::NAME => $productUnitSelection, PriceType::NAME => $priceType, CurrencySelectionType::NAME => new CurrencySelectionType($configManager, $localeSettings)], []), new ValidatorExtension(Validation::createValidator())]; }
/** * {@inheritdoc} */ protected function getExtensions() { $productSelectType = new EntityType([1 => $this->getEntity('OroB2B\\Bundle\\ProductBundle\\Entity\\Product', 1, 'id'), 2 => $this->getEntity('OroB2B\\Bundle\\ProductBundle\\Entity\\Product', 2, 'id')], ProductPriceListAwareSelectType::NAME); return array_merge(parent::getExtensions(), [new PreloadedExtension([$productSelectType->getName() => $productSelectType], [])]); }
/** * {@inheritdoc} */ protected function getExtensions() { $productUnitSelectionType = new StubProductUnitSelectionType([1], ProductUnitSelectionType::NAME); $productUnitRemovedSelectionType = new StubProductUnitRemovedSelectionType(); $entityType = new EntityType(['1']); return [new PreloadedExtension([$productUnitSelectionType->getName() => $productUnitSelectionType, $productUnitRemovedSelectionType->getName() => $productUnitRemovedSelectionType, $entityType->getName() => $entityType], []), $this->getValidatorExtension(true)]; }
/** * @return array */ protected function getExtensions() { $entityType = new EntityType([1 => $this->getShoppingList(1, 'Shopping List 1'), 2 => $this->getShoppingList(2, 'Shopping List 2')]); $productUnitSelection = new EntityType($this->prepareProductUnitSelectionChoices(), ProductUnitSelectionType::NAME); return [new PreloadedExtension([FrontendLineItemType::NAME => $this->getParentForm(), $entityType->getName() => $entityType, ProductUnitSelectionType::NAME => $productUnitSelection], [])]; }
/** * @return array */ protected function getExtensions() { $entityIdentifierType = new EntityIdentifierType([]); $accountSelectType = new AccountSelectTypeStub($this->getAccounts(), AccountSelectType::NAME); return [new PreloadedExtension([$entityIdentifierType->getName() => $entityIdentifierType, $accountSelectType->getName() => $accountSelectType, 'oro_acl_collection' => new PrivilegeCollectionType(), AclPriviledgeTypeStub::NAME => new AclPriviledgeTypeStub()], []), new ValidatorExtension(Validation::createValidator())]; }
/** * {@inheritdoc} */ protected function getExtensions() { $productSelectType = new ProductSelectTypeStub(); $productRemovedSelectType = new ProductRemovedSelectType(); $productRemovedSelectType->setTranslator($this->translator); $entityType = new EntityType(['1']); return [new PreloadedExtension([$productSelectType->getName() => $productSelectType, $productRemovedSelectType->getName() => $productRemovedSelectType, $entityType->getName() => $entityType], []), $this->getValidatorExtension(true)]; }
/** * {@inheritdoc} */ protected function getExtensions() { /* @var $productUnitLabelFormatter ProductUnitLabelFormatter|\PHPUnit_Framework_MockObject_MockObject */ $productUnitLabelFormatter = $this->getMockBuilder('OroB2B\\Bundle\\ProductBundle\\Formatter\\ProductUnitLabelFormatter')->disableOriginalConstructor()->getMock(); $priceType = $this->preparePriceType(); $entityType = $this->prepareProductEntityType(); $optionalPriceType = $this->prepareOptionalPriceType(); $currencySelectionType = new CurrencySelectionTypeStub(); $requestProductItemType = $this->prepareRequestProductItemType(); $productUnitSelectionType = $this->prepareProductUnitSelectionType(); $accountSelectType = new StubEntityType([1 => $this->getEntity('OroB2B\\Bundle\\AccountBundle\\Entity\\Account', 1), 2 => $this->getEntity('OroB2B\\Bundle\\AccountBundle\\Entity\\Account', 2)], AccountSelectType::NAME); $accountUserSelectType = new StubEntityType([1 => $this->getEntity('OroB2B\\Bundle\\AccountBundle\\Entity\\AccountUser', 1), 2 => $this->getEntity('OroB2B\\Bundle\\AccountBundle\\Entity\\AccountUser', 2)], AccountUserSelectType::NAME); $requestStatusSelectType = new StubEntityType([1 => $this->getEntity('OroB2B\\Bundle\\RFPBundle\\Entity\\RequestStatus', 1)], RequestStatusSelectType::NAME); $requestProductType = new RequestProductType($productUnitLabelFormatter); $requestProductType->setDataClass('OroB2B\\Bundle\\RFPBundle\\Entity\\RequestProduct'); return [new PreloadedExtension([CollectionType::NAME => new CollectionType(), RequestProductCollectionType::NAME => new RequestProductCollectionType(), RequestProductItemCollectionType::NAME => new RequestProductItemCollectionType(), ProductRemovedSelectType::NAME => new StubProductRemovedSelectType(), ProductUnitRemovedSelectionType::NAME => new StubProductUnitRemovedSelectionType(), $priceType->getName() => $priceType, $entityType->getName() => $entityType, $optionalPriceType->getName() => $optionalPriceType, $accountSelectType->getName() => $accountSelectType, $requestProductType->getName() => $requestProductType, $accountUserSelectType->getName() => $accountUserSelectType, $currencySelectionType->getName() => $currencySelectionType, $requestProductItemType->getName() => $requestProductItemType, $requestStatusSelectType->getName() => $requestStatusSelectType, $productUnitSelectionType->getName() => $productUnitSelectionType], []), $this->getValidatorExtension(true)]; }
/** * @return array */ protected function getExtensions() { $rolesEntity = new EntityType([1 => $this->getRole(1, 'test01'), 2 => $this->getRole(2, 'test02')]); $customerSelectType = new CustomerSelectTypeStub($this->getCustomers(), 'orob2b_customer_select'); return [new PreloadedExtension([OroDateType::NAME => new OroDateType(), 'entity' => $rolesEntity, $customerSelectType->getName() => $customerSelectType], []), new ValidatorExtension(Validation::createValidator())]; }
/** * {@inheritdoc} */ protected function getExtensions() { /* @var $translator \PHPUnit_Framework_MockObject_MockObject|TranslatorInterface */ $translator = $this->getMockBuilder('Symfony\\Component\\Translation\\TranslatorInterface')->disableOriginalConstructor()->getMock(); /* @var $productUnitLabelFormatter \PHPUnit_Framework_MockObject_MockObject|ProductUnitLabelFormatter */ $productUnitLabelFormatter = $this->getMockBuilder('OroB2B\\Bundle\\ProductBundle\\Formatter\\ProductUnitLabelFormatter')->disableOriginalConstructor()->getMock(); $userSelectType = new EntityType([1 => $this->getEntity('Oro\\Bundle\\UserBundle\\Entity\\User', 1), 2 => $this->getEntity('Oro\\Bundle\\UserBundle\\Entity\\User', 2)], 'oro_user_select'); $priceType = $this->preparePriceType(); $entityType = $this->prepareProductEntityType(); $productSelectType = new ProductSelectTypeStub(); $currencySelectionType = new CurrencySelectionTypeStub(); $productUnitSelectionType = $this->prepareProductUnitSelectionType(); $quoteProductOfferType = $this->prepareQuoteProductOfferType($translator); $quoteProductRequestType = $this->prepareQuoteProductRequestType($translator); $quoteProductType = new QuoteProductType($translator, $productUnitLabelFormatter, $this->quoteProductFormatter); $quoteProductType->setDataClass('OroB2B\\Bundle\\SaleBundle\\Entity\\QuoteProduct'); return [new PreloadedExtension([OroDateTimeType::NAME => new OroDateTimeType(), CollectionType::NAME => new CollectionType(), QuoteProductOfferType::NAME => new QuoteProductOfferType($translator, $this->quoteProductOfferFormatter), QuoteProductCollectionType::NAME => new QuoteProductCollectionType(), QuoteProductOfferCollectionType::NAME => new QuoteProductOfferCollectionType(), QuoteProductRequestCollectionType::NAME => new QuoteProductRequestCollectionType(), $priceType->getName() => $priceType, $entityType->getName() => $entityType, $userSelectType->getName() => $userSelectType, $quoteProductType->getName() => $quoteProductType, $productSelectType->getName() => $productSelectType, $currencySelectionType->getName() => $currencySelectionType, $quoteProductOfferType->getName() => $quoteProductOfferType, $quoteProductRequestType->getName() => $quoteProductRequestType, $productUnitSelectionType->getName() => $productUnitSelectionType], []), $this->getValidatorExtension(true)]; }