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