/** * @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], [])]; }
/** * {@inheritdoc} */ protected function getExtensions() { /* @var $configManager \PHPUnit_Framework_MockObject_MockObject|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 $localeSettings \PHPUnit_Framework_MockObject_MockObject|LocaleSettings */ $localeSettings = $this->getMockBuilder('Oro\\Bundle\\LocaleBundle\\Model\\LocaleSettings')->disableOriginalConstructor()->getMock(); $currencyPrice = new PriceType(); $currencyPrice->setDataClass('Oro\\Bundle\\CurrencyBundle\\Model\\Price'); return [new PreloadedExtension([CurrencySelectionType::NAME => new CurrencySelectionType($configManager, $localeSettings), $currencyPrice->getName() => $currencyPrice], []), $this->getValidatorExtension(true)]; }
/** * Test getName */ public function testGetName() { $this->assertEquals(PriceType::NAME, $this->formType->getName()); }