当前位置: 首页>>代码示例>>PHP>>正文


PHP PHPUnit_Framework_MockObject_MockObject::setData方法代码示例

本文整理汇总了PHP中PHPUnit_Framework_MockObject_MockObject::setData方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Framework_MockObject_MockObject::setData方法的具体用法?PHP PHPUnit_Framework_MockObject_MockObject::setData怎么用?PHP PHPUnit_Framework_MockObject_MockObject::setData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PHPUnit_Framework_MockObject_MockObject的用法示例。


在下文中一共展示了PHPUnit_Framework_MockObject_MockObject::setData方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testGetShippingDataObject

 /**
  * @param array $addressData
  * @param bool $useBaseCurrency
  * @param string $shippingTaxClass
  * @param bool shippingPriceInclTax
  * @param array $expectedValue
  * @dataProvider getShippingDataObjectDataProvider
  */
 public function testGetShippingDataObject(array $addressData, $useBaseCurrency, $shippingTaxClass, $shippingPriceInclTax)
 {
     $baseShippingAmount = $addressData['base_shipping_amount'];
     $shippingAmount = $addressData['shipping_amount'];
     $itemMock = $this->getMock('Magento\\Tax\\Api\\Data\\QuoteDetailsItemInterface');
     $this->taxConfig->expects($this->any())->method('getShippingTaxClass')->with($this->store)->will($this->returnValue($shippingTaxClass));
     $this->taxConfig->expects($this->any())->method('shippingPriceIncludesTax')->with($this->store)->will($this->returnValue($shippingPriceInclTax));
     $this->address->expects($this->atLeastOnce())->method('getShippingDiscountAmount')->willReturn($shippingAmount);
     if ($shippingAmount) {
         if ($useBaseCurrency && $shippingAmount != 0) {
             $this->address->expects($this->once())->method('getBaseShippingDiscountAmount')->willReturn($baseShippingAmount);
             $this->quoteDetailsItemBuilderMock->expects($this->once())->method('setDiscountAmount')->with($baseShippingAmount);
         } else {
             $this->address->expects($this->never())->method('getBaseShippingDiscountAmount');
             $this->quoteDetailsItemBuilderMock->expects($this->once())->method('setDiscountAmount')->with($shippingAmount);
         }
     }
     foreach ($addressData as $key => $value) {
         $this->address->setData($key, $value);
     }
     $this->taxClassKeyBuilderMock->expects($this->any())->method('setType')->willReturnSelf();
     $this->taxClassKeyBuilderMock->expects($this->any())->method('setValue')->with($shippingTaxClass)->willReturnSelf();
     $this->quoteDetailsItemBuilderMock->expects($this->once())->method('create')->willReturn($itemMock);
     $this->assertEquals($itemMock, $this->commonTaxCollector->getShippingDataObject($this->address, $useBaseCurrency));
 }
开发者ID:ViniciusAugusto,项目名称:magento2,代码行数:33,代码来源:CommonTaxCollectorTest.php

示例2: testValidateArrayOperatorType

 /**
  * @param $existingValue
  * @param $operator
  * @param $valueForValidate
  * @param $expectedResult
  * @param $inputType
  *
  * @dataProvider validateAttributeArrayInputTypeDataProvider
  */
 public function testValidateArrayOperatorType($existingValue, $operator, $valueForValidate, $expectedResult, $inputType)
 {
     $this->_condition->setOperator($operator);
     $this->_condition->setData('value_parsed', $existingValue);
     $this->_condition->getDefaultOperatorInputByType();
     $this->_condition->expects($this->any())->method('getInputType')->will($this->returnValue($inputType));
     $this->assertEquals($expectedResult, $this->_condition->validateAttribute($valueForValidate), "Failed asserting that " . var_export($existingValue, true) . $operator . var_export($valueForValidate, true));
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:17,代码来源:AbstractConditionTest.php

示例3: testGetInfoData

 /**
  * @dataProvider getInfoDataProvider
  */
 public function testGetInfoData($field, $value, $expected)
 {
     $methodInstance = $this->getMockBuilder('\\Magento\\Payment\\Model\\Method\\AbstractMethod')->setMethods(['getData'])->disableOriginalConstructor()->getMock();
     $methodInstance->expects($this->any())->method('getData')->with($field)->will($this->returnValue($value));
     $method = $this->getMockBuilder('Magento\\Payment\\Model\\MethodInterface')->getMockForAbstractClass();
     $method->expects($this->any())->method('getInfoInstance')->will($this->returnValue($methodInstance));
     $this->_object->setData('method', $method);
     $this->assertEquals($expected, $this->_object->getInfoData($field));
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:12,代码来源:FormTest.php

示例4: testJsonEncode_EncodesData

 public function testJsonEncode_EncodesData()
 {
     $testData = 'something something 123';
     $testType = 'testType';
     $expected = json_encode(['type' => $testType, 'data' => $testData]);
     $this->abstractCommand->expects($this->once())->method('getType')->willReturn('testType');
     $this->abstractCommand->setData($testData);
     $this->assertJsonStringEqualsJsonString($expected, json_encode($this->abstractCommand));
 }
开发者ID:zwilias,项目名称:qman,代码行数:9,代码来源:AbstractCommandTest.php

示例5: testValidate

 /**
  * @dataProvider validateDataProvider
  * @param bool $value
  */
 public function testValidate($value)
 {
     $attributeCode = 'attr_code';
     $attribute = $this->getMock('Magento\\Eav\\Model\\Entity\\Attribute', ['getAttributeCode', 'getIsRequired', 'isValueEmpty', 'getIsUnique', 'getEntityType', '__wakeup'], [], '', false);
     $attributeEntity = $this->getMock('\\Magento\\Framework\\Model\\ResourceModel\\AbstractResourceAbstractEntity', ['checkAttributeUniqueValue']);
     $attribute->expects($this->any())->method('getAttributeCode')->will($this->returnValue($attributeCode));
     $attribute->expects($this->any())->method('getIsRequired')->will($this->returnValue(true));
     $attribute->expects($this->any())->method('isValueEmpty')->will($this->returnValue($value));
     $attribute->expects($this->any())->method('getIsUnique')->will($this->returnValue(true));
     $attribute->expects($this->any())->method('getEntityType')->will($this->returnValue($attributeEntity));
     $attributeEntity->expects($this->any())->method('checkAttributeUniqueValue')->will($this->returnValue(true));
     $this->attributeRepository->expects($this->once())->method('get')->with('media_gallery')->willReturn($attribute);
     $this->dataObject->setData(['attr_code' => 'attribute data']);
     $this->assertEquals(!$value, $this->model->validate($this->dataObject));
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:19,代码来源:ProcessorTest.php

示例6: testGetIsSecureMode

 /**
  * @dataProvider getIsSecureModeDataProvider
  * @param bool $isSecureMode
  * @param bool $methodInstance
  * @param bool $store
  * @param string $storeCode
  * @param bool $expectedResult
  */
 public function testGetIsSecureMode($isSecureMode, $methodInstance, $store, $storeCode, $expectedResult)
 {
     if (isset($store)) {
         $methodInstance = $this->_getMethodInstanceMock($store);
     }
     if (isset($storeCode)) {
         $storeMock = $this->_getStoreMock($storeCode);
         $this->_storeManager->expects($this->any())->method('getStore')->will($this->returnValue($storeMock));
     }
     $paymentInfo = $this->getMockBuilder('\\Magento\\Payment\\Model\\Info')->disableOriginalConstructor()->getMock();
     $paymentInfo->expects($this->any())->method('getMethodInstance')->will($this->returnValue($methodInstance));
     $this->_object->setData('info', $paymentInfo);
     $this->_object->setData('is_secure_mode', $isSecureMode);
     $result = $this->_object->getIsSecureMode();
     $this->assertEquals($result, $expectedResult);
 }
开发者ID:Atlis,项目名称:docker-magento2,代码行数:24,代码来源:InfoTest.php

示例7: testSaveValidation

 /**
  * @param array $badStoreData
  *
  * @dataProvider saveValidationDataProvider
  * @magentoAppIsolation enabled
  * @magentoAppArea adminhtml
  * @magentoDbIsolation enabled
  * @expectedException \Magento\Framework\Exception\LocalizedException
  */
 public function testSaveValidation($badStoreData)
 {
     $normalStoreData = ['code' => 'test', 'website_id' => 1, 'group_id' => 1, 'name' => 'test name', 'sort_order' => 0, 'is_active' => 1];
     $data = array_merge($normalStoreData, $badStoreData);
     $this->model->setData($data);
     $this->model->save();
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:16,代码来源:StoreTest.php

示例8: testPrepareValueOptions

 /**
  * @param array $setData
  * @param string $attributeObjectFrontendInput
  * @param array $attrObjectSourceAllOptionsValue
  * @param array $attrSetCollectionOptionsArray
  * @param bool $expectedAttrObjSourceAllOptionsParam
  * @param array $expectedValueSelectOptions
  * @param array $expectedValueOption
  * @dataProvider prepareValueOptionsDataProvider
  * @SuppressWarnings(PHPMD.NPathComplexity)
  */
 public function testPrepareValueOptions($setData, $attributeObjectFrontendInput, $attrObjectSourceAllOptionsValue, $attrSetCollectionOptionsArray, $expectedAttrObjSourceAllOptionsParam, $expectedValueSelectOptions, $expectedValueOption)
 {
     foreach ($setData as $key => $value) {
         $this->_condition->setData($key, $value);
     }
     $attrObjectSourceMock = $this->getMockBuilder('Magento\\Eav\\Model\\Entity\\Attribute\\Source\\AbstractSource')->setMethods(['getAllOptions'])->disableOriginalConstructor()->getMock();
     $attrObjectSourceMock->expects(null === $expectedAttrObjSourceAllOptionsParam ? $this->never() : $this->once())->method('getAllOptions')->with($expectedAttrObjSourceAllOptionsParam)->willReturn($attrObjectSourceAllOptionsValue);
     $attributeObjectMock = $this->getMockBuilder('Magento\\Catalog\\Model\\ResourceModel\\Eav\\Attribute')->setMethods(['usesSource', 'getFrontendInput', 'getSource', 'getAllOptions'])->disableOriginalConstructor()->getMock();
     $attributeObjectMock->method('usesSource')->willReturn(true);
     $attributeObjectMock->expects(null === $attributeObjectFrontendInput ? $this->never() : $this->once())->method('getFrontendInput')->willReturn($attributeObjectFrontendInput);
     $attributeObjectMock->method('getSource')->willReturn($attrObjectSourceMock);
     $entityTypeMock = $this->getMockBuilder('Magento\\Framework\\Model\\AbstractModel\\Type')->setMethods(['getId'])->disableOriginalConstructor()->getMock();
     $entityTypeMock->method('getId')->willReturn('SomeEntityType');
     $configValueMock = $this->getMock('Magento\\Eav\\Model\\Config', ['getAttribute', 'getEntityType'], [], '', false);
     $configValueMock->method('getAttribute')->willReturn($attributeObjectMock);
     $configValueMock->method('getEntityType')->willReturn($entityTypeMock);
     $configProperty = new ReflectionProperty('Magento\\Rule\\Model\\Condition\\Product\\AbstractProduct', '_config');
     $configProperty->setAccessible(true);
     $configProperty->setValue($this->_condition, $configValueMock);
     $attrSetCollectionValueMock = $this->getMockBuilder('Magento\\Eav\\Model\\ResourceModel\\Entity\\Attribute\\Set\\Collection')->setMethods(['setEntityTypeFilter', 'load', 'toOptionArray'])->disableOriginalConstructor()->getMock();
     $attrSetCollectionValueMock->method('setEntityTypeFilter')->will($this->returnSelf());
     $attrSetCollectionValueMock->method('load')->will($this->returnSelf());
     $attrSetCollectionValueMock->expects(null === $attrSetCollectionOptionsArray ? $this->never() : $this->once())->method('toOptionArray')->willReturn($attrSetCollectionOptionsArray);
     $attrSetCollectionProperty = new ReflectionProperty('Magento\\Rule\\Model\\Condition\\Product\\AbstractProduct', '_attrSetCollection');
     $attrSetCollectionProperty->setAccessible(true);
     $attrSetCollectionProperty->setValue($this->_condition, $attrSetCollectionValueMock);
     $testedMethod = new ReflectionMethod('Magento\\Rule\\Model\\Condition\\Product\\AbstractProduct', '_prepareValueOptions');
     $testedMethod->setAccessible(true);
     $testedMethod->invoke($this->_condition);
     $this->assertEquals($expectedValueSelectOptions, $this->_condition->getData('value_select_options'));
     $this->assertEquals($expectedValueOption, $this->_condition->getData('value_option'));
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:43,代码来源:AbstractProductTest.php

示例9: testCRUD

 /**
  * @magentoAppIsolation enabled
  */
 public function testCRUD()
 {
     $this->_model->setData(array('code' => 'test', 'website_id' => 1, 'group_id' => 1, 'name' => 'test name', 'sort_order' => 0, 'is_active' => 1));
     /* emulate admin store */
     Mage::app()->getStore()->setId(Mage_Core_Model_App::ADMIN_STORE_ID);
     $crud = new Magento_Test_Entity($this->_model, array('name' => 'new name'));
     $crud->testCrud();
 }
开发者ID:relue,项目名称:magento2,代码行数:11,代码来源:StoreTest.php

示例10: testCollect

 /**
  * @param array $orderData
  * @param array $invoiceData
  * @param array $expectedResults
  * @dataProvider collectDataProvider
  */
 public function testCollect($orderData, $invoiceData, $expectedResults)
 {
     $roundingDelta = [];
     $this->setupOrder($orderData);
     //Set up weeeData mock
     $this->weeeData->expects($this->once())->method('includeInSubtotal')->will($this->returnValue($invoiceData['include_in_subtotal']));
     //Set up invoice mock
     /** @var \Magento\Sales\Model\Order\Invoice\Item[] $invoiceItems */
     $invoiceItems = [];
     foreach ($invoiceData['items'] as $itemKey => $invoiceItemData) {
         $invoiceItems[$itemKey] = $this->getInvoiceItem($invoiceItemData);
     }
     $this->invoice->expects($this->once())->method('getAllItems')->will($this->returnValue($invoiceItems));
     $this->invoice->expects($this->once())->method('isLast')->will($this->returnValue($invoiceData['is_last']));
     foreach ($invoiceData['data_fields'] as $key => $value) {
         $this->invoice->setData($key, $value);
     }
     $this->invoice->expects($this->any())->method('roundPrice')->will($this->returnCallback(function ($price, $type) use(&$roundingDelta) {
         if (!isset($roundingDelta[$type])) {
             $roundingDelta[$type] = 0;
         }
         $roundedPrice = round($price + $roundingDelta[$type], 2);
         $roundingDelta[$type] = $price - $roundedPrice;
         return $roundedPrice;
     }));
     $this->model->collect($this->invoice);
     //verify invoice data
     foreach ($expectedResults['invoice_data'] as $key => $value) {
         $this->assertEquals($value, $this->invoice->getData($key), 'Invoice data field ' . $key . ' is incorrect');
     }
     //verify invoice item data
     foreach ($expectedResults['invoice_items'] as $itemKey => $itemData) {
         $invoiceItem = $invoiceItems[$itemKey];
         foreach ($itemData as $key => $value) {
             if ($key == 'tax_ratio') {
                 $taxRatio = unserialize($invoiceItem->getData($key));
                 $expectedTaxRatio = unserialize($itemData[$key]);
                 $this->assertEquals($expectedTaxRatio['weee'], $taxRatio['weee'], "Tax ratio is incorrect");
             } else {
                 $this->assertEquals($value, $invoiceItem->getData($key), 'Invoice item field ' . $key . ' is incorrect');
             }
         }
     }
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:50,代码来源:WeeeTest.php

示例11: testCalculate

 /**
  * @covers \Magento\SalesRule\Model\Rule\Action\Discount\CartFixed::calculate
  */
 public function testCalculate()
 {
     $this->rule->setData(['id' => 1, 'discount_amount' => 10.0]);
     $this->address->expects($this->any())->method('getCartFixedRules')->will($this->returnValue([]));
     $store = $this->getMock('Magento\\Store\\Model\\Store', [], [], '', false);
     $this->priceCurrency->expects($this->atLeastOnce())->method('convert')->will($this->returnArgument(0));
     $this->priceCurrency->expects($this->atLeastOnce())->method('round')->will($this->returnArgument(0));
     $this->quote->expects($this->any())->method('getStore')->will($this->returnValue($store));
     /** validators data */
     $this->validator->expects($this->once())->method('getItemPrice')->with($this->item)->will($this->returnValue(100));
     $this->validator->expects($this->once())->method('getItemBasePrice')->with($this->item)->will($this->returnValue(100));
     $this->validator->expects($this->once())->method('getItemOriginalPrice')->with($this->item)->will($this->returnValue(100));
     $this->validator->expects($this->once())->method('getItemBaseOriginalPrice')->with($this->item)->will($this->returnValue(100));
     $this->address->expects($this->once())->method('setCartFixedRules')->with([1 => 0.0]);
     $this->model->calculate($this->rule, $this->item, 1);
     $this->assertEquals($this->data->getAmount(), 10);
     $this->assertEquals($this->data->getBaseAmount(), 10);
     $this->assertEquals($this->data->getOriginalAmount(), 10);
     $this->assertEquals($this->data->getBaseOriginalAmount(), 100);
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:23,代码来源:CartFixedTest.php

示例12: testCollect

 /**
  * @param array $orderData
  * @param array $creditmemoData
  * @param array $expectedResults
  * @dataProvider collectDataProvider
  */
 public function testCollect($orderData, $creditmemoData, $expectedResults)
 {
     $roundingDelta = [];
     //Set up order mock
     foreach ($orderData['data_fields'] as $key => $value) {
         $this->order->setData($key, $value);
     }
     //Set up creditmemo mock
     /** @var \Magento\Sales\Model\Order\Creditmemo\Item[] $creditmemoItems */
     $creditmemoItems = [];
     foreach ($creditmemoData['items'] as $itemKey => $creditmemoItemData) {
         $creditmemoItems[$itemKey] = $this->getCreditmemoItem($creditmemoItemData);
     }
     $this->creditmemo->expects($this->once())->method('getAllItems')->will($this->returnValue($creditmemoItems));
     $this->creditmemo->expects($this->any())->method('isLast')->will($this->returnValue($creditmemoData['is_last']));
     foreach ($creditmemoData['data_fields'] as $key => $value) {
         $this->creditmemo->setData($key, $value);
     }
     $this->creditmemo->expects($this->any())->method('roundPrice')->will($this->returnCallback(function ($price, $type) use(&$roundingDelta) {
         if (!isset($roundingDelta[$type])) {
             $roundingDelta[$type] = 0;
         }
         $roundedPrice = round($price + $roundingDelta[$type], 2);
         $roundingDelta[$type] = $price - $roundedPrice;
         return $roundedPrice;
     }));
     $this->model->collect($this->creditmemo);
     //verify invoice data
     foreach ($expectedResults['creditmemo_data'] as $key => $value) {
         $this->assertEquals($value, $this->creditmemo->getData($key));
     }
     //verify invoice item data
     foreach ($expectedResults['creditmemo_items'] as $itemKey => $itemData) {
         $creditmemoItem = $creditmemoItems[$itemKey];
         foreach ($itemData as $key => $value) {
             $this->assertEquals($value, $creditmemoItem->getData($key));
         }
     }
 }
开发者ID:tingyeeh,项目名称:magento2,代码行数:45,代码来源:TaxTest.php

示例13: testApplyRulesThatAppliedRuleIdsAreCollected

 public function testApplyRulesThatAppliedRuleIdsAreCollected()
 {
     $positivePrice = 1;
     $ruleId1 = 123;
     $ruleId2 = 234;
     $expectedRuleIds = [$ruleId1 => $ruleId1, $ruleId2 => $ruleId2];
     $this->model->init($this->model->getWebsiteId(), $this->model->getCustomerGroupId(), $this->model->getCouponCode());
     $this->item->setDiscountCalculationPrice($positivePrice);
     $this->item->setData('calculation_price', $positivePrice);
     $this->model->setSkipActionsValidation(true);
     $this->rulesApplier->expects($this->once())->method('applyRules')->with($this->equalTo($this->item), $this->equalTo($this->ruleCollection), $this->anything(), $this->anything())->will($this->returnValue($expectedRuleIds));
     $this->rulesApplier->expects($this->once())->method('setAppliedRuleIds')->with($this->anything(), $expectedRuleIds);
     $this->model->process($this->item);
 }
开发者ID:buskamuza,项目名称:magento2-skeleton,代码行数:14,代码来源:ValidatorTest.php

示例14: startTestGetProductCollection

 /**
  * @param string $displayType
  * @param bool $pagerEnable
  * @param int $productsCount
  * @param int $productsPerPage
  */
 protected function startTestGetProductCollection($displayType, $pagerEnable, $productsCount, $productsPerPage)
 {
     $productCollectionFactory = $this->getMock('Magento\\Catalog\\Model\\ResourceModel\\Product\\CollectionFactory', ['create'], [], '', false, false);
     $productCollectionFactory->expects($this->atLeastOnce())->method('create')->willReturn($this->productCollection);
     $this->block = $this->objectManager->getObject('Magento\\Catalog\\Block\\Product\\Widget\\NewWidget', ['context' => $this->context, 'productCollectionFactory' => $productCollectionFactory]);
     if (null === $productsPerPage) {
         $this->block->unsetData('products_per_page');
     } else {
         $this->block->setData('products_per_page', $productsPerPage);
     }
     $this->block->setData('show_pager', $pagerEnable);
     $this->block->setData('display_type', $displayType);
     $this->block->setProductsCount($productsCount);
     $this->block->toHtml();
 }
开发者ID:IlyaGluschenko,项目名称:test001,代码行数:21,代码来源:NewWidgetTest.php

示例15: testSaveExistingWithMediaGalleryEntries

 public function testSaveExistingWithMediaGalleryEntries()
 {
     //update one entry, delete one entry
     $newEntries = [['id' => 5, "label" => "new_label_text", 'file' => 'filename1', 'position' => 10, 'disabled' => false, 'types' => ['image', 'small_image']]];
     $existingMediaGallery = ['images' => [['value_id' => 5, "label" => "label_text", 'file' => 'filename1', 'position' => 10, 'disabled' => true], ['value_id' => 6, 'file' => 'filename2']]];
     $expectedResult = [['id' => 5, 'value_id' => 5, "label" => "new_label_text", 'file' => 'filename1', 'position' => 10, 'disabled' => false, 'types' => ['image', 'small_image']], ['value_id' => 6, 'file' => 'filename2', 'removed' => true]];
     $this->setupProductMocksForSave();
     //media gallery data
     $this->productData['media_gallery_entries'] = $newEntries;
     $this->extensibleDataObjectConverterMock->expects($this->once())->method('toNestedArray')->will($this->returnValue($this->productData));
     $this->initializedProductMock->setData('media_gallery', $existingMediaGallery);
     $this->initializedProductMock->expects($this->any())->method('getMediaAttributes')->willReturn(["image" => "filename1", "small_image" => "filename2"]);
     $this->mediaGalleryProcessor->expects($this->once())->method('clearMediaAttribute')->with($this->initializedProductMock, ['image', 'small_image']);
     $this->mediaGalleryProcessor->expects($this->once())->method('setMediaAttribute')->with($this->initializedProductMock, ['image', 'small_image'], 'filename1');
     $this->initializedProductMock->expects($this->once())->method('getWebsiteIds')->willReturn([]);
     $this->model->save($this->productMock);
     $this->assertEquals($expectedResult, $this->initializedProductMock->getMediaGallery('images'));
 }
开发者ID:dragonsword007008,项目名称:magento2,代码行数:18,代码来源:ProductRepositoryTest.php


注:本文中的PHPUnit_Framework_MockObject_MockObject::setData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。