本文整理汇总了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());
}
示例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();
}
示例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());
}
示例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]));
}
示例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));
}
示例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();
}