當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Test\FormIntegrationTestCase類代碼示例

本文整理匯總了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);
 }
開發者ID:hirenbhut93,項目名稱:MopaBootstrapBundle,代碼行數:28,代碼來源:AbstractDivLayoutTest.php

示例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);
 }
開發者ID:aml-bendall,項目名稱:ExpandAkeneoApi,代碼行數:7,代碼來源:ChangePasswordSubscriberTest.php

示例3: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->formType = new AccountGroupType();
     $this->formType->setDataClass(self::DATA_CLASS);
     $this->formType->setAccountClass(self::ACCOUNT_CLASS);
 }
開發者ID:adam-paterson,項目名稱:orocommerce,代碼行數:10,代碼來源:AccountGroupTypeTest.php

示例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();
 }
開發者ID:Maksold,項目名稱:platform,代碼行數:7,代碼來源:ReportChartSchemaCollectionTypeTest.php

示例5: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->type = new FrontendLineItemType();
     $this->type->setDataClass(self::DATA_CLASS);
     $this->type->setLineItemSubscriber($this->getLineItemSubscriber());
 }
開發者ID:adam-paterson,項目名稱:orocommerce,代碼行數:10,代碼來源:FrontendLineItemTypeTest.php

示例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);
 }
開發者ID:hafeez3000,項目名稱:orocommerce,代碼行數:7,代碼來源:AttributeTypeConstraintTypeTest.php

示例7: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->formType = new CustomerGroupType();
     $this->formType->setDataClass(self::DATA_CLASS);
     $this->formType->setCustomerClass(self::CUSTOMER_CLASS);
 }
開發者ID:hafeez3000,項目名稱:orocommerce,代碼行數:10,代碼來源:CustomerGroupTypeTest.php

示例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);
 }
開發者ID:Maksold,項目名稱:platform,代碼行數:7,代碼來源:OroSimpleColorChoiceTypeTest.php

示例9: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $translator = $this->createTranslatorMock();
     $this->formType = new AccountTypedAddressWithDefaultType($translator);
     $this->formType->setRegistry($this->registry);
 }
開發者ID:adam-paterson,項目名稱:orocommerce,代碼行數:10,代碼來源:AccountTypedAddressWithDefaultTypeTest.php

示例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');
 }
開發者ID:hafeez3000,項目名稱:orocommerce,代碼行數:10,代碼來源:CustomerTypedAddressTypeTest.php

示例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);
 }
開發者ID:ramunasd,項目名稱:platform,代碼行數:7,代碼來源:OroSimpleColorPickerTypeTest.php

示例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();
 }
開發者ID:hafeez3000,項目名稱:orocommerce,代碼行數:10,代碼來源:ProductTypeTest.php

示例13: tearDown

 protected function tearDown()
 {
     parent::tearDown();
     \Locale::setDefault($this->locale);
     unset($this->locale);
     unset($this->formType);
 }
開發者ID:Maksold,項目名稱:platform,代碼行數:7,代碼來源:OroPercentTypeTest.php

示例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);
 }
開發者ID:hafeez3000,項目名稱:orocommerce,代碼行數:8,代碼來源:AttributeTypeTypeTest.php

示例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);
 }
開發者ID:adam-paterson,項目名稱:orocommerce,代碼行數:11,代碼來源:AccountUserTypeTest.php


注:本文中的Symfony\Component\Form\Test\FormIntegrationTestCase類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。