本文整理汇总了PHP中AbstractEntity::getDefaultBehavior方法的典型用法代码示例。如果您正苦于以下问题:PHP AbstractEntity::getDefaultBehavior方法的具体用法?PHP AbstractEntity::getDefaultBehavior怎么用?PHP AbstractEntity::getDefaultBehavior使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AbstractEntity
的用法示例。
在下文中一共展示了AbstractEntity::getDefaultBehavior方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dataProviderForTestGetBehaviorWithRowData
/**
* Different cases to cover all code parts in AbstractEntity::getBehavior()
*
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @return array
*/
public function dataProviderForTestGetBehaviorWithRowData()
{
return ["add/update behavior and row with delete in action column" => ['$inputBehavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_ADD_UPDATE, '$rowData' => [AbstractEntity::COLUMN_ACTION => AbstractEntity::COLUMN_ACTION_VALUE_DELETE], '$expectedBehavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_ADD_UPDATE], "delete behavior and row with delete in action column" => ['$inputBehavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_DELETE, '$rowData' => [AbstractEntity::COLUMN_ACTION => AbstractEntity::COLUMN_ACTION_VALUE_DELETE], '$expectedBehavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_DELETE], "custom behavior and row with delete in action column" => ['$inputBehavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_CUSTOM, '$rowData' => [AbstractEntity::COLUMN_ACTION => AbstractEntity::COLUMN_ACTION_VALUE_DELETE], '$expectedBehavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_DELETE], "add/update behavior and row with update in action column" => ['$inputBehavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_ADD_UPDATE, '$rowData' => [AbstractEntity::COLUMN_ACTION => 'update'], '$expectedBehavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_ADD_UPDATE], "delete behavior and row with update in action column" => ['$inputBehavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_DELETE, '$rowData' => [AbstractEntity::COLUMN_ACTION => 'update'], '$expectedBehavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_DELETE], "custom behavior and row with update in action column" => ['$inputBehavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_CUSTOM, '$rowData' => [AbstractEntity::COLUMN_ACTION => 'update'], '$expectedBehavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_ADD_UPDATE], "add/update behavior and row with bogus string in action column" => ['$inputBehavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_ADD_UPDATE, '$rowData' => [AbstractEntity::COLUMN_ACTION => microtime(true)], '$expectedBehavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_ADD_UPDATE], "delete behavior and row with bogus string in action column" => ['$inputBehavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_DELETE, '$rowData' => [AbstractEntity::COLUMN_ACTION => microtime(true)], '$expectedBehavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_DELETE], "custom behavior and row with bogus string in action column" => ['$inputBehavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_CUSTOM, '$rowData' => [AbstractEntity::COLUMN_ACTION => microtime(true)], '$expectedBehavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_ADD_UPDATE], "add/update behavior and row with null in action column" => ['$inputBehavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_ADD_UPDATE, '$rowData' => [AbstractEntity::COLUMN_ACTION => null], '$expectedBehavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_ADD_UPDATE], "delete behavior and row with null in action column" => ['$inputBehavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_DELETE, '$rowData' => [AbstractEntity::COLUMN_ACTION => null], '$expectedBehavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_DELETE], "custom behavior and row with null in action column" => ['$inputBehavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_CUSTOM, '$rowData' => [AbstractEntity::COLUMN_ACTION => null], '$expectedBehavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_ADD_UPDATE], "add/update behavior and empty row" => ['$inputBehavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_ADD_UPDATE, '$rowData' => null, '$expectedBehavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_ADD_UPDATE], "delete behavior and empty row" => ['$inputBehavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_DELETE, '$rowData' => null, '$expectedBehavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_DELETE], "custom behavior and empty row" => ['$inputBehavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_CUSTOM, '$rowData' => null, '$expectedBehavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_CUSTOM], "add/update behavior and row is empty array" => ['$inputBehavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_ADD_UPDATE, '$rowData' => [], '$expectedBehavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_ADD_UPDATE], "delete behavior and empty row is empty array" => ['$inputBehavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_DELETE, '$rowData' => [], '$expectedBehavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_DELETE], "custom behavior and empty row is empty array" => ['$inputBehavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_CUSTOM, '$rowData' => [], '$expectedBehavior' => AbstractEntity::getDefaultBehavior()], "custom behavior and row with delete in action column and empty available behaviors" => ['$inputBehavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_CUSTOM, '$rowData' => [AbstractEntity::COLUMN_ACTION => AbstractEntity::COLUMN_ACTION_VALUE_DELETE], '$expectedBehavior' => AbstractEntity::getDefaultBehavior(), '$availableBehaviors' => []], "custom behavior and row with update in action column and empty available behaviors" => ['$inputBehavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_CUSTOM, '$rowData' => [AbstractEntity::COLUMN_ACTION => 'update'], '$expectedBehavior' => AbstractEntity::getDefaultBehavior(), '$availableBehaviors' => []], "custom behavior and row with bogus string in action column and empty available behaviors" => ['$inputBehavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_CUSTOM, '$rowData' => [AbstractEntity::COLUMN_ACTION => microtime(true)], '$expectedBehavior' => AbstractEntity::getDefaultBehavior(), '$availableBehaviors' => []], "custom behavior and row with null in action column and empty available behaviors" => ['$inputBehavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_CUSTOM, '$rowData' => [AbstractEntity::COLUMN_ACTION => null], '$expectedBehavior' => AbstractEntity::getDefaultBehavior(), '$availableBehaviors' => []]];
}