wc-smooth-generator icon indicating copy to clipboard operation
wc-smooth-generator copied to clipboard

[Feature Request] Expose generate_* methods for reusability

Open moon0326 opened this issue 3 years ago • 2 comments

Hi ✋

I found this package while testing a feature in WooCommerce Admin. This is a really awesome package for testing 👍

I wanted to use generate_variable_product method in my test where I needed to create a few variable products, but the method is inaccessible as it is protected. I ended up copying the code into my test class.

I can either extend the class to expose generate_* methods or use reflection to make them public on the fly, but I would prefer avoiding workarounds.

Is there a plan to expose generate_* methods? It would be very useful.

I can make a PR if you approve.

moon0326 avatar Jan 15 '21 00:01 moon0326

@moon0326 It's great to hear that you found Smooth Generator useful. We don't have any current plans to do new development.

However, if you are interested in submitting a PR, we would look at an enhancement that added a --product_type= option to the generate command. That would allow people to create test installs with a predefined distribution of product types.

rrennick avatar Jan 15 '21 13:01 rrennick

@moon0326 It's great to hear that you found Smooth Generator useful. We don't have any current plans to do new development.

However, if you are interested in submitting a PR, we would look at an enhancement that added a --product_type= option to the generate command. That would allow people to create test installs with a predefined distribution of product types.

That sounds great! I will make a PR soon 👍 Thank you!

moon0326 avatar Jan 15 '21 23:01 moon0326

@moon0326 I went ahead and added a type parameter to the product generator in #113

coreymckrill avatar Mar 13 '23 23:03 coreymckrill