本文整理汇总了PHP中Symfony\Component\Form\Test\FormIntegrationTestCase::setUp方法的典型用法代码示例。如果您正苦于以下问题:PHP FormIntegrationTestCase::setUp方法的具体用法?PHP FormIntegrationTestCase::setUp怎么用?PHP FormIntegrationTestCase::setUp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\Form\Test\FormIntegrationTestCase
的用法示例。
在下文中一共展示了FormIntegrationTestCase::setUp方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
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);
}
示例2: setUp
/**
* {@inheritdoc}
*/
protected function setUp()
{
parent::setUp();
$this->type = new FrontendLineItemType();
$this->type->setDataClass(self::DATA_CLASS);
$this->type->setLineItemSubscriber($this->getLineItemSubscriber());
}
示例3: setUp
/**
* {@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();
}
示例4: 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);
}
示例5: setUp
/**
* {@inheritdoc}
*/
protected function setUp()
{
parent::setUp();
$this->formType = new AccountGroupType();
$this->formType->setDataClass(self::DATA_CLASS);
$this->formType->setAccountClass(self::ACCOUNT_CLASS);
}
示例6: setUp
/**
* {@inheritdoc}
*/
protected function setUp()
{
parent::setUp();
$translator = $this->createTranslatorMock();
$this->formType = new AccountTypedAddressWithDefaultType($translator);
$this->formType->setRegistry($this->registry);
}
示例7: setUp
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);
}
示例8: setUp
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();
}
示例9: 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);
}
示例10: setUp
protected function setUp()
{
parent::setUp();
$this->locale = \Locale::getDefault();
\Locale::setDefault('en');
$this->formType = new OroPercentType();
}
示例11: setUp
/**
* {@inheritdoc}
*/
protected function setUp()
{
parent::setUp();
$this->formType = new CustomerGroupType();
$this->formType->setDataClass(self::DATA_CLASS);
$this->formType->setCustomerClass(self::CUSTOMER_CLASS);
}
示例12: setUp
/**
* {@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');
}
示例13: setUp
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);
}
示例14: setUp
/**
* @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);
}
示例15: setUp
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);
}