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


PHP PHPUnit_Framework_MockObject_MockObject::setParameters方法代码示例

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


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

示例1: testValidateDataColumnNameWithWhitespacesForDeleteBehaviour

 /**
  * Test for method validateData() for delete behaviour
  *
  * @covers \Magento\ImportExport\Model\Import\Entity\AbstractEntity::validateData
  */
 public function testValidateDataColumnNameWithWhitespacesForDeleteBehaviour()
 {
     $this->_createSourceAdapterMock(['  ']);
     $this->_model->setParameters(['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_DELETE]);
     $errorAggregator = $this->_model->validateData();
     $this->assertEquals(0, $errorAggregator->getErrorsCount());
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:12,代码来源:AbstractTest.php

示例2: testImportDataWithCustomBehaviour

 /**
  * Test whether correct methods are invoked in case of custom behaviour for each row in action column
  */
 public function testImportDataWithCustomBehaviour()
 {
     $this->_model = $this->_getModelMockForTestImportDataWithCustomBehaviour();
     $this->_model->setParameters(['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_CUSTOM]);
     // validation in validateSaveCustomerEntities and validateDeleteCustomerEntities
     $this->_model->importData();
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:10,代码来源:CustomerTest.php

示例3: testValidateEmailForDeleteBehavior

 public function testValidateEmailForDeleteBehavior()
 {
     $this->_customerData[Customer::COLUMN_EMAIL] = 'new.customer@example.com';
     $this->_model->setParameters(['behavior' => Import::BEHAVIOR_DELETE]);
     $this->_model->validateRow($this->_customerData, 0);
     $this->assertGreaterThan(0, $this->_model->getErrorsCount());
     $this->assertArrayHasKey(Customer::ERROR_CUSTOMER_NOT_FOUND, $this->_model->getErrorMessages());
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:8,代码来源:CustomerTest.php

示例4: testValidateEmailForDeleteBehavior

 public function testValidateEmailForDeleteBehavior()
 {
     $this->_model->getErrorAggregator()->clear();
     $this->_customerData[Customer::COLUMN_EMAIL] = 'new.customer@example.com';
     $this->_model->setParameters(['behavior' => Import::BEHAVIOR_DELETE]);
     $this->_model->validateRow($this->_customerData, 0);
     $this->assertGreaterThan(0, $this->_model->getErrorAggregator()->getErrorsCount());
     $this->assertNotEmpty($this->_model->getErrorAggregator()->getErrorsByCode([Customer::ERROR_CUSTOMER_NOT_FOUND]));
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:9,代码来源:CustomerTest.php

示例5: testValidateRowForDelete

 public function testValidateRowForDelete()
 {
     // _validateRowForDelete should be called only once
     $this->_model->expects($this->once())->method('_validateRowForDelete');
     // delete action
     $this->_model->setParameters(['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_DELETE]);
     $this->_clearValidatedRows();
     $this->assertAttributeEquals([], '_validatedRows', $this->_model);
     $this->assertTrue($this->_model->validateRow([], 2));
     $this->assertAttributeEquals([2 => true], '_validatedRows', $this->_model);
     $this->assertAttributeEquals(1, '_processedEntitiesCount', $this->_model);
     $this->assertTrue($this->_model->validateRow([], 2));
 }
开发者ID:tingyeeh,项目名称:magento2,代码行数:13,代码来源:AbstractCustomerTest.php

示例6: testValidateDataColumnNameWithWhitespacesForDeleteBehaviour

 /**
  * Test for method validateData() for delete behaviour
  *
  * @covers \Magento\ImportExport\Model\Import\Entity\AbstractEntity::validateData
  */
 public function testValidateDataColumnNameWithWhitespacesForDeleteBehaviour()
 {
     $this->_createSourceAdapterMock(['  ']);
     $this->_model->setParameters(['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_DELETE]);
     $this->_model->validateData();
 }
开发者ID:kid17,项目名称:magento2,代码行数:11,代码来源:AbstractTest.php


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