【问题标题】:EcomDev PHPUnit 'Entity Id should be specified in EAV fixture'EcomDev PHPUnit '应在 EAV 夹具中指定实体 ID'
【发布时间】:2014-04-03 01:21:12
【问题描述】:
Uncaught exception 'RuntimeException' with message 'Entity Id should be specified in EAV fixture'

Superior/Base/Test/Model/Test/fixtures/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

尝试加载一个fixture,到目前为止它处理了EAV中的entity_id之前的所有内容。我在顶部得到错误

【问题讨论】:

    标签: php magento phpunit yaml


    【解决方案1】:

    在这些行中添加两个空格:

      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 具有相同的缩进。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-01-14
      • 2021-02-13
      • 1970-01-01
      • 2021-11-08
      • 2012-04-04
      • 2013-08-06
      • 1970-01-01
      相关资源
      最近更新 更多