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

Use orchestra/testbench-core as testbench should only be used for Package development #359

Merged
merged 4 commits into from
Mar 12, 2024

Conversation

crynobone
Copy link
Contributor

@crynobone crynobone commented Nov 16, 2023

In package development, orchestra/testbench should be added explicitly which then requires orchestra/workbench, orchestra/canvas etc which isn't useful for this package usage when used in Laravel project.

@alies-dev
Copy link
Collaborator

thank you, @crynobone ! I'll take a look into it soon, but firstly would like to understand why orchestra packages are not in dev requirements. It will take some time, but I'll do my best, thanks

@crynobone
Copy link
Contributor Author

but firstly would like to understand why orchestra packages are not in dev requirements.

It is being used directly via the following class:

use Orchestra\Testbench\Concerns\CreatesApplication;
use function define;
use function defined;
use function dirname;
use function file_exists;
use function get_class;
use function getcwd;
use function microtime;
final class ApplicationProvider
{
use CreatesApplication;

So changing to orchestra/testbench-core will be the most minimal changes to avoid loading requirements available via orchestra/testbench when using this package.

Copy link
Collaborator

@alies-dev alies-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@crynobone

I have some questions regarding these changes in dependencies, can you please take a look?

composer.json Outdated
@@ -24,7 +25,7 @@
"illuminate/support": "^9.48 || ^10.0",
"illuminate/view": "^9.48 || ^10.0",
"nikic/php-parser": "^4.13",
"orchestra/testbench": "^7.19 || ^8.0",
"orchestra/testbench-core": "^7.35 || ^8.15",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^7.35 || ^8.15"

Do these versions contain for required functionality, or are they just to enforce new versions?

Note, this plugin built to support old versions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both versions contain conflict restrictions (using composer.json) to ensure Testbench Core 7 will only be used with Laravel 9 and Testbench Core 8 only used with Laravel 10.

composer.json Outdated
@@ -14,6 +14,7 @@
"php": "^8.0.2",
"ext-simplexml": "*",
"barryvdh/laravel-ide-helper": "^2.13",
"fakerphp/faker": "^1.21",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't find places where we use Faker on this package. Do you know them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -34,6 +35,7 @@
"codeception/module-cli": "^2.0",
"codeception/module-filesystem": "^3.0",
"codeception/module-phpbrowser": "^3.0",
"laravel/framework": "^9.48 || ^10.0",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this package is made to support both Laravel and Lumen. I'm not sure that require Laravel is a good idea.

Copy link
Contributor Author

@crynobone crynobone Nov 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only require-dev deps. Previously was provided in require via orchestra/testbench.

So this actually improves support for Lumen.

@alies-dev
Copy link
Collaborator

Great, thank you, @crynobone
I see some issues caused updates on the trunk branch, but I'll fix them on my own.

@alies-dev alies-dev merged commit e6394fd into psalm:master Mar 12, 2024
4 of 14 checks passed
@alies-dev alies-dev added the release:internal for PRs only (used by release-drafter) label Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:internal for PRs only (used by release-drafter)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants