Automattic / wordbless

WorDBless allows you to use WordPress core functions in your PHPUnit tests without having to set up a database and the whole WordPress environment
Other
131 stars 6 forks source link

Move phpunit-polyfills to dev-requirements #66

Open heiglandreas opened 10 months ago

heiglandreas commented 10 months ago

Without PHPUnit these polyfills do not make any sense. In addition to that not having them in the dev-dependencies will download phpunit into any project regardless of whether the project uses phpunit or not.

I would even argue that roots/wordpress should be a dev- requirement as using this package with any other composer based wordpress installation will download wordpress twice - and possibly overwrite the installation with a different version resulting in unpredictable results – which is not really what one wants in a testing setup

leogermani commented 10 months ago

I would even argue that roots/wordpress should be a dev- requirement

WorDBless is usually a dev requirement of another project, but wordpress core will be needed there, so it can't be a dev dependency of WorDBless... but there's an open discussion to move the files somewhere else -> https://github.com/Automattic/wordbless/issues/32

heiglandreas commented 10 months ago

Best option would actually be to require a WordPress. But that would mean that there is a meta-package "wordpress-implementation" that this could then require.

So this one would

{
    "require": {
        "wordpress-implementation": "^6.4"
    }
}

and automatic/wordpress and f.e. johnpblock/wordpress would both contain

{
    "provide": {
        "wordpress-implementation": "6.4"
    }
}

But as the later isn't available currently.... :shrug: