protected function setUp() { parent::setUp(); $configManager = $this->getMockBuilder('Oro\\Bundle\\ConfigBundle\\Config\\ConfigManager')->disableOriginalConstructor()->getMock(); $translatorInterface = $this->getMockBuilder('Symfony\\Component\\Translation\\TranslatorInterface')->disableOriginalConstructor()->getMock(); $this->formType = new OroSimpleColorPickerType($configManager, $translatorInterface); }
/** * {@inheritdoc} */ protected function setUp() { parent::setUp(); $this->type = new FrontendLineItemType(); $this->type->setDataClass(self::DATA_CLASS); $this->type->setLineItemSubscriber($this->getLineItemSubscriber()); }
/** * {@inheritDoc} */ protected function setUp() { $this->roundingService = $this->getMockBuilder('OroB2B\\Bundle\\ProductBundle\\Rounding\\RoundingService')->disableOriginalConstructor()->getMock(); $this->type = new ProductType($this->roundingService); $this->type->setDataClass(self::DATA_CLASS); parent::setUp(); }
protected function setUp() { parent::setUp(); $this->localeSettings = $this->getMockBuilder('Oro\\Bundle\\LocaleBundle\\Model\\LocaleSettings')->disableOriginalConstructor()->setMethods(array('getLocale', 'getCurrency', 'getCurrencySymbolByCurrency'))->getMock(); $this->numberFormatter = $this->getMockBuilder('Oro\\Bundle\\LocaleBundle\\Formatter\\NumberFormatter')->disableOriginalConstructor()->setMethods(array('isCurrencySymbolPrepend', 'getAttribute'))->getMock(); $this->formType = new OroMoneyType($this->localeSettings, $this->numberFormatter); }
/** * {@inheritdoc} */ protected function setUp() { parent::setUp(); $this->formType = new AccountGroupType(); $this->formType->setDataClass(self::DATA_CLASS); $this->formType->setAccountClass(self::ACCOUNT_CLASS); }
/** * {@inheritdoc} */ protected function setUp() { parent::setUp(); $translator = $this->createTranslatorMock(); $this->formType = new AccountTypedAddressWithDefaultType($translator); $this->formType->setRegistry($this->registry); }
protected function setUp() { parent::setUp(); $configManager = $this->getMockBuilder('Oro\\Bundle\\ConfigBundle\\Config\\ConfigManager')->disableOriginalConstructor()->getMock(); $configManager->expects($this->any())->method('get')->will($this->returnValue(['#FFFFFF', '#000000'])); $this->formType = new OroSimpleColorChoiceType($configManager); }
protected function setUp() { $this->configProvider = $this->getMockBuilder('\\Oro\\Bundle\\ChartBundle\\Model\\ConfigProvider')->disableOriginalConstructor()->getMock(); $this->configProvider->expects($this->once())->method('getChartConfigs')->will($this->returnValue(['line_chart' => ['data_schema' => [['label' => 'label', 'name' => 'name', 'required' => false]]]])); $this->type = new ReportChartSchemaCollectionType($this->configProvider); parent::setUp(); }
public function setUp() { parent::setUp(); $this->tokenStorage = $this->getMockForAbstractClass('Symfony\\Component\\Security\\Core\\TokenStorageInterface'); $this->token = $this->getMockBuilder('Symfony\\Component\\Security\\Core\\Authentication\\Token\\TokenInterface')->disableOriginalConstructor()->getMock(); $this->subscriber = new ChangePasswordSubscriber($this->factory, $this->tokenStorage); }
protected function setUp() { parent::setUp(); $this->locale = \Locale::getDefault(); \Locale::setDefault('en'); $this->formType = new OroPercentType(); }
/** * {@inheritdoc} */ protected function setUp() { parent::setUp(); $this->formType = new CustomerGroupType(); $this->formType->setDataClass(self::DATA_CLASS); $this->formType->setCustomerClass(self::CUSTOMER_CLASS); }
/** * {@inheritdoc} */ protected function setUp() { parent::setUp(); $this->formType = new CustomerTypedAddressType(); $this->formType->setAddressTypeDataClass('Oro\\Bundle\\AddressBundle\\Entity\\AddressType'); $this->formType->setDataClass('OroB2B\\Bundle\\CustomerBundle\\Entity\\CustomerAddress'); }
protected function setUp() { $this->locale = \Locale::getDefault(); parent::setUp(); $this->cmMock = $this->getMockBuilder('Oro\\Bundle\\ConfigBundle\\Config\\ConfigManager')->disableOriginalConstructor()->getMock(); $this->formType = new LanguageType($this->cmMock); }
/** * @throws \Twig_Error_Loader */ protected function setUp() { // Setup factory for tabs $this->tabFactory = Forms::createFormFactory(); parent::setUp(); $rendererEngine = new TwigRendererEngine(array('form_div_layout.html.twig', 'fields.html.twig')); if (interface_exists('Symfony\\Component\\Security\\Csrf\\CsrfTokenManagerInterface')) { $csrfProviderInterface = 'Symfony\\Component\\Security\\Csrf\\CsrfTokenManagerInterface'; } else { $csrfProviderInterface = 'Symfony\\Component\\Form\\Extension\\Csrf\\CsrfProvider\\CsrfProviderInterface'; } $renderer = new TwigRenderer($rendererEngine, $this->getMock($csrfProviderInterface)); $this->extension = new FormExtension($renderer); $reflection = new \ReflectionClass($renderer); $bridgeDirectory = dirname($reflection->getFileName()) . '/../Resources/views/Form'; $loader = new \Twig_Loader_Filesystem(array($bridgeDirectory, __DIR__ . '/../../Resources/views/Form')); $loader->addPath(__DIR__ . '/../../Resources/views', 'MopaBootstrap'); $environment = new Twig_Environment($loader, array('strict_variables' => true)); $environment->addExtension(new TranslationExtension(new StubTranslator())); $environment->addExtension(new IconExtension('fontawesome')); $environment->addExtension(new FormExtension2()); $environment->addGlobal('global', ''); $environment->addExtension($this->extension); $this->extension->initRuntime($environment); }
protected function setUp() { parent::setUp(); $genderProvider = $this->getMockBuilder('Oro\\Bundle\\UserBundle\\Provider\\GenderProvider')->disableOriginalConstructor()->setMethods(array('getChoices'))->getMock(); $genderProvider->expects($this->any())->method('getChoices')->will($this->returnValue($this->genderChoices)); $this->type = new GenderType($genderProvider); }
protected function setUp() { parent::setUp(); $this->type = $this->getMockBuilder('Oro\\Bundle\\FormBundle\\Form\\Type\\OroJquerySelect2HiddenType')->setMethods(array('createDefaultTransformer'))->setConstructorArgs(array($this->getMockEntityManager(), $this->getMockSearchRegistry()))->getMock(); /*$this->type->expects($this->any())->method('createDefaultTransformer') ->will($this->returnValue($this->getMockEntityToIdTransformer()));*/ }
protected function setUp() { parent::setUp(); $this->registry = $this->getMockBuilder('OroB2B\\Bundle\\AttributeBundle\\AttributeType\\AttributeTypeRegistry')->getMock(); $this->registry->expects($this->any())->method('getTypeByName')->will($this->returnValueMap([[Integer::NAME, new Integer()], [Float::NAME, new Float()], [String::NAME, new String()], [Boolean::NAME, new Boolean()], [Text::NAME, new Text()], [Date::NAME, new Date()], [DateTime::NAME, new DateTime()]])); $this->formType = new AttributeTypeConstraintType($this->registry); }
/** * {@inheritDoc} */ protected function setUp() { parent::setUp(); $this->newPaymentTerm = new PaymentTerm(); $this->formType = new PaymentTermType(get_class($this->newPaymentTerm)); $this->formType->setAccountClass(self::ACCOUNT_CLASS); $this->formType->setAccountGroupClass(self::ACCOUNT_GROUP_CLASS); }
protected function setUp() { parent::setUp(); $this->configManager = $this->getMockBuilder('Oro\\Bundle\\ConfigBundle\\Config\\ConfigManager')->disableOriginalConstructor()->getMock(); $this->userManager = $this->getMockBuilder('Oro\\Bundle\\UserBundle\\Entity\\UserManager')->disableOriginalConstructor()->getMock(); $this->formType = new FrontendAccountUserRegistrationType($this->configManager, $this->userManager); $this->formType->setDataClass('OroB2B\\Bundle\\AccountBundle\\Entity\\AccountUser'); }
public function setUp() { $this->settingsProvider = $this->getMockBuilder('OroCRM\\Bundle\\ChannelBundle\\Provider\\SettingsProvider')->disableOriginalConstructor()->getMock(); $this->settingsProvider->expects($this->any())->method('getEntitiesByChannelType')->will($this->returnValue(['OroCRM\\Bundle\\AcmeBundle\\Entity\\Test1', 'OroCRM\\Bundle\\AcmeBundle\\Entity\\Test2'])); $this->settingsProvider->expects($this->any())->method('getCustomerIdentityFromConfig')->with(self::TEST_CHANNEL_TYPE)->will($this->returnValue(self::TEST_CUSTOMER_IDENTITY)); $this->subscriber = new ChannelTypeSubscriber($this->settingsProvider); parent::setUp(); }
/** * {@inheritdoc} */ protected function setUp() { $this->roundingService = $this->getMockBuilder('OroB2B\\Bundle\\ProductBundle\\Rounding\\RoundingService')->disableOriginalConstructor()->getMock(); $this->formType = new PriceListProductPriceType($this->getRegistry(), $this->roundingService); $this->formType->setDataClass('OroB2B\\Bundle\\PricingBundle\\Entity\\ProductPrice'); $this->formType->setProductClass('OroB2B\\Bundle\\ProductBundle\\Entity\\Product'); parent::setUp(); }
public function setUp() { $this->entityConfigProvider = $this->getMockBuilder('Oro\\Bundle\\EntityConfigBundle\\Provider\\ConfigProvider')->disableOriginalConstructor()->getMock(); $this->translator = $this->getMockBuilder('Oro\\Bundle\\TranslationBundle\\Translation\\Translator')->disableOriginalConstructor()->getMock(); parent::setUp(); $this->registry = $this->getMockBuilder('Symfony\\Bridge\\Doctrine\\ManagerRegistry')->disableOriginalConstructor()->getMock(); $this->type = new ChannelDatasourceType($this->registry, $this->testEntityName); }
/** * {@inheritdoc} */ protected function setUp() { parent::setUp(); $this->securityFacade = $this->getMockBuilder('Oro\\Bundle\\SecurityBundle\\SecurityFacade')->disableOriginalConstructor()->getMock(); $this->formType = new AccountUserType($this->securityFacade); $this->formType->setDataClass(self::DATA_CLASS); $this->formType->setAddressClass(self::ADDRESS_CLASS); }
protected function setUp() { parent::setUp(); $registry = $this->getMockBuilder('OroB2B\\Bundle\\AttributeBundle\\AttributeType\\AttributeTypeRegistry')->getMock(); $registry->expects($this->any())->method('getTypes')->will($this->returnValue([Integer::NAME => new Integer(), Float::NAME => new Float(), String::NAME => new String(), Boolean::NAME => new Boolean(), Text::NAME => new Text(), Date::NAME => new Date(), DateTime::NAME => new DateTime()])); /** @var \OroB2B\Bundle\AttributeBundle\AttributeType\AttributeTypeRegistry $registry */ $this->formType = new AttributeTypeType($registry); }
protected function setUp() { parent::setUp(); /** @var TranslatorInterface $translator */ $this->translator = $this->getMock('Symfony\\Component\\Translation\\TranslatorInterface'); $this->translator->expects($this->any())->method('trans')->with('orob2b.fallback.type.parent_locale')->willReturn('Parent Locale'); $this->formType = new FallbackPropertyType($this->translator); }
/** * {@inheritDoc} */ protected function setUp() { parent::setUp(); $this->configManager = $this->getMockBuilder('Oro\\Bundle\\ConfigBundle\\Config\\ConfigManager')->setMethods(['get'])->disableOriginalConstructor()->getMock(); $this->localeSettings = $this->getMockBuilder('Oro\\Bundle\\LocaleBundle\\Model\\LocaleSettings')->setMethods(['getCurrency', 'getLocale'])->disableOriginalConstructor()->getMock(); $this->localeSettings->expects($this->any())->method('getLocale')->willReturn(\Locale::getDefault()); $this->formType = new CurrencySelectionType($this->configManager, $this->localeSettings); }
protected function setUp() { $this->configProvider = $this->getMockBuilder('Oro\\Bundle\\ChartBundle\\Model\\ConfigProvider')->disableOriginalConstructor()->getMock(); $mock = $this->getMockBuilder('Oro\\Bundle\\ChartBundle\\Form\\EventListener\\ChartTypeEventListener')->getMock(); $eventListener = new MutableFormEventSubscriber($mock); $this->type = new ChartType($this->configProvider); $this->type->setEventListener($eventListener); parent::setUp(); }
/** * {@inheritDoc} */ protected function setUp() { parent::setUp(); $this->type = new PriceListType(); $this->type->setDataClass(self::DATA_CLASS); $this->type->setCustomerClass(self::CUSTOMER_CLASS); $this->type->setCustomerGroupClass(self::CUSTOMER_GROUP_CLASS); $this->type->setWebsiteClass(self::WEBSITE_CLASS); }
protected function setUp() { if (!extension_loaded('intl')) { $this->markTestSkipped('The "intl" extension is not available'); } \Locale::setDefault('en'); $this->csrfProvider = $this->getMock('Symfony\\Component\\Form\\Extension\\Csrf\\CsrfProvider\\CsrfProviderInterface'); parent::setUp(); }
protected function setUp() { if (!extension_loaded('intl')) { $this->markTestSkipped('Extension intl is required.'); } \Locale::setDefault('en'); $this->csrfTokenManager = $this->getMock('Symfony\\Component\\Security\\Csrf\\CsrfTokenManagerInterface'); parent::setUp(); }