dingo-d / wp-pest

A package that will add WordPress integration test suite with Pest
MIT License
119 stars 5 forks source link

Support plugins with numbers in their names #15

Closed Flynsarmy closed 2 years ago

Flynsarmy commented 2 years ago

Describe your bug

Running wp-pest setup plugin with certain valid plugin names (In my case qps-s3) result in the error

Plugin slug must be written in lowercase, separated by a dash.

Steps to Reproduce

In my plugin folder:

composer require dingo-d/wp-pest-integration-test-setup --dev
vendor/bin/wp-pest setup plugin --plugin-slug=qps-s3

[ERROR] Plugin slug must be written in lowercase, separated by a dash.

vendor/bin/wp-pest setup plugin --plugin-slug="qps-s3"

[ERROR] Plugin slug must be written in lowercase, separated by a dash.

vendor/bin/wp-pest setup plugin --plugin-slug=qpss3

[ERROR] Plugin slug must be written in lowercase, separated by a dash.

vendor/bin/wp-pest setup plugin --plugin-slug=myplugin

[OK] Folder and files created successfully.

I then had to open tests/bootstrap.php and change myplugin.php to qps-s3.php in the _manually_load_plugin() method.

Expected behavior

The first setup plugin line above should work.

Screenshots, screen recording, code snippet

No response

Environment info

Please confirm that you have searched existing issues in this repo.

Yes

dingo-d commented 2 years ago

Thanks for reporting the bug!

I think my plugin slug checking is a bit too strict and doesn't allow numbers or emojies. Will need to add this to the validation check.

dingo-d commented 2 years ago

@Flynsarmy This should be fixed in version 1.4.1, can you check? Thanks!

Flynsarmy commented 2 years ago

Works perfectly. Thank you very much!