EcomDev PHPUnit'实体ID应在EAV夹具中指定'

时间:2014-03-02 00:23:43

标签: php magento phpunit yaml

Uncaught exception 'RuntimeException' with message 'Entity Id should be specified in EAV fixture'

高级/碱/测试/型号/测试/装置/ priceCalculation.yaml

scope:
  website: # Initialize websites
    - website_id: 2
      code: usa_website
      name: USA Website
      default_group_id: 2
    - website_id: 3
      code: canada_website
      name: Canada Website
      default_group_id: 3
    - website_id: 4
      code: german_website
      name: German Website
      default_group_id: 4
  group: # Initializes store groups
    - group_id: 2
      website_id: 2
      name: USA Store Group
      default_store_id: 2
      root_category_id: 2 # Default Category
    - group_id: 3
      website_id: 3
      name: Canada Store Group
      default_store_id: 3
      root_category_id: 2 # Default Category
    - group_id: 4
      website_id: 4
      name: German Store Group
      default_store_id: 4
      root_category_id: 2 # Default Category
  store: # Initializes store views
    - store_id: 2
      website_id: 2
      group_id: 2
      code: usa
      name: USA Store
      is_active: 1
    - store_id: 3
      website_id: 3
      group_id: 3
      code: canada
      name: Canada Store
      is_active: 1
    - store_id: 4
      website_id: 4
      group_id: 4
      code: germany
      name: Germany
      is_active: 1
config:
  default/catalog/price/scope: 1 # Set price scope to website

eav:
  catalog_product:
    - entity_id: 1
      type_id: simple
      sku: book
      name: Book
      short_description: Book
      description: Book
      url_key: book
      stock:
        qty: 100.00
        is_in_stock: 1
      website_ids:
      - usa_website
      - canada_website
      - german_website
    category_ids:
      - 2 # Default Category
    price: 12.99
    tax_class_id: 2 # Taxable Goods
    status: 1 # Enabled
    visibility: 4 # Visible in Catalog & Search
    /websites: # Set different prices per website
      usa_website:
        special_price: 9.99
      german_website:
        price: 9.99
        special_price: 5.99

尝试加载一个灯具,到目前为止,它处理EAV中的entity_id。我在顶部得到了错误

1 个答案:

答案 0 :(得分:0)

为这些行添加两个空格:

  category_ids:
    - 2 # Default Category
  price: 12.99
  tax_class_id: 2 # Taxable Goods
  status: 1 # Enabled
  visibility: 4 # Visible in Catalog & Search
  /websites: # Set different prices per website
    usa_website:
      special_price: 9.99
    german_website:
      price: 9.99
      special_price: 5.99

此数据属于您的entity_id: 1产品。因此,您必须缩进行,以便它们是产品定义的一部分。它们应与type_idwebsite_ids具有相同的缩进。