/** * {@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 StubEntityType([1 => $this->getEntity('Oro\\Bundle\\UserBundle\\Entity\\User', 1), 2 => $this->getEntity('Oro\\Bundle\\UserBundle\\Entity\\User', 2)], 'oro_user_select'); $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); $priceType = $this->preparePriceType(); $entityType = $this->prepareProductEntityType(); $productSelectType = new ProductSelectTypeStub(); $currencySelectionType = new CurrencySelectionTypeStub(); $productUnitSelectionType = $this->prepareProductUnitSelectionType(); $quoteProductOfferType = $this->prepareQuoteProductOfferType(); $quoteProductRequestType = $this->prepareQuoteProductRequestType(); $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($this->quoteProductOfferFormatter), QuoteProductCollectionType::NAME => new QuoteProductCollectionType(), QuoteProductOfferCollectionType::NAME => new QuoteProductOfferCollectionType(), QuoteProductRequestCollectionType::NAME => new QuoteProductRequestCollectionType(), ProductRemovedSelectType::NAME => new StubProductRemovedSelectType(), ProductUnitRemovedSelectionType::NAME => new StubProductUnitRemovedSelectionType(), $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, $accountSelectType->getName() => $accountSelectType, $accountUserSelectType->getName() => $accountUserSelectType], []), $this->getValidatorExtension(true)]; }
/** * {@inheritdoc} */ protected function getExtensions() { /* @var $translator \PHPUnit_Framework_MockObject_MockObject|TranslatorInterface */ $translator = $this->getMock('Symfony\\Component\\Translation\\TranslatorInterface'); $priceType = $this->preparePriceType(); $entityType = $this->prepareProductEntityType(); $optionalPriceType = $this->prepareOptionalPriceType(); $productSelectType = new ProductSelectTypeStub(); $currencySelectionType = new CurrencySelectionTypeStub(); $requestProductItemType = $this->prepareRequestProductItemType($translator); $productUnitSelectionType = $this->prepareProductUnitSelectionType(); $requestProductType = new RequestProductType($translator); $requestProductType->setDataClass('OroB2B\\Bundle\\RFPBundle\\Entity\\RequestProduct'); return [new PreloadedExtension([CollectionType::NAME => new CollectionType(), RequestProductCollectionType::NAME => new RequestProductCollectionType(), RequestProductItemCollectionType::NAME => new RequestProductItemCollectionType(), $priceType->getName() => $priceType, $entityType->getName() => $entityType, $optionalPriceType->getName() => $optionalPriceType, $productSelectType->getName() => $productSelectType, $requestProductType->getName() => $requestProductType, $currencySelectionType->getName() => $currencySelectionType, $requestProductItemType->getName() => $requestProductItemType, $productUnitSelectionType->getName() => $productUnitSelectionType], []), $this->getValidatorExtension(true)]; }
/** * {@inheritdoc} */ protected function getExtensions() { $priceType = $this->preparePriceType(); $entityType = $this->prepareProductEntityType(); $productSelectType = new ProductSelectTypeStub(); $currencySelectionType = new CurrencySelectionTypeStub(); $productUnitSelectionType = $this->prepareProductUnitSelectionType(); $quoteProductOfferType = $this->prepareQuoteProductOfferType($this->translator); $quoteProductRequestType = $this->prepareQuoteProductRequestType($this->translator); return [new PreloadedExtension([CollectionType::NAME => new CollectionType(), QuoteProductOfferCollectionType::NAME => new QuoteProductOfferCollectionType(), QuoteProductRequestCollectionType::NAME => new QuoteProductRequestCollectionType(), $priceType->getName() => $priceType, $entityType->getName() => $entityType, $productSelectType->getName() => $productSelectType, $currencySelectionType->getName() => $currencySelectionType, $quoteProductOfferType->getName() => $quoteProductOfferType, $quoteProductRequestType->getName() => $quoteProductRequestType, $productUnitSelectionType->getName() => $productUnitSelectionType], []), $this->getValidatorExtension(true)]; }
/** * {@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() { $priceType = $this->preparePriceType(); $entityType = $this->prepareProductEntityType(); $optionalPriceType = $this->prepareOptionalPriceType(); $productSelectType = new ProductSelectTypeStub(); $currencySelectionType = new CurrencySelectionTypeStub(); $requestProductItemType = $this->prepareRequestProductItemType($this->translator); $productUnitSelectionType = $this->prepareProductUnitSelectionType(); return [new PreloadedExtension([CollectionType::NAME => new CollectionType(), RequestProductItemCollectionType::NAME => new RequestProductItemCollectionType(), $priceType->getName() => $priceType, $entityType->getName() => $entityType, $optionalPriceType->getName() => $optionalPriceType, $productSelectType->getName() => $productSelectType, $requestProductItemType->getName() => $requestProductItemType, $currencySelectionType->getName() => $currencySelectionType, $productUnitSelectionType->getName() => $productUnitSelectionType], []), $this->getValidatorExtension(true)]; }