Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attachment #13

Open
pretzlaw opened this issue Jun 6, 2020 · 0 comments
Open

Attachment #13

pretzlaw opened this issue Jun 6, 2020 · 0 comments

Comments

@pretzlaw
Copy link

pretzlaw commented Jun 6, 2020

Add file to media

WP_Post:
  the_att:
    type: attachment
    meta_input:
      _wp_attached_file: <image()>

could be simplified to

attachment: # or media:
  the_att:
    file: <image()>

Mock:

  • thumbnail_id will be 0 until persisted

Persistence:

  • Forces the file in no matter if the file type is allowed or not

Attach such media to entities

WP_Post:
  post_with_att:
    type: foo
    meta_input:
      _thumbnail_id: "@the_att"

could become

WP_Post:
  post_with_att:
    type: foo
    thumbnail: "@the_att"

Provider

May need ...

  • <wp_upload_dir($time)> which returns wp_upload_dir($time)['path'] by default
  • <wp_max_upload_size()> to create files which are exactly this big or slightly bigger/smaller for testing purposes
  • <wp_get_mime_types()> and <wp_get_mime_type()> to randomly select one
  • <get_allowed_mime_types($unfiltered = false)> and <get_allowed_mime_type()> to randomly select one
  • <get_intermediate_image_sizes('thumbnail')>, <get_intermediate_image_size()>, get_intermediate_image_width('thumbnail') and get_intermediate_image_height(...) to randomly select one
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant