DEV Community

bravemaster619
bravemaster619

Posted on

1

How to pass arguments to custom composer script

In my Laravel project, I want to run phpunit for a single file, like this one:

$ composer run-script test tests/Unit/Services/OrderServiceTest.php

Here is my composer setup:

"scripts": {
    "test": [
        "@testenv"
        "@phpunit"
    ],
    "testenv": [
        "php artisan config:cache --env=testing",
        "php artisan config:clear"
    ],
    "phpunit": [
        "php ./vendor/phpunit/phpunit/phpunit --"
    ]
}

Top comments (0)

Image of Docusign

Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more