wp-launchpad / cli
CLI library for the Launchpad framework
Installs: 1 834
Dependents: 26
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 0
Open Issues: 4
Requires
- ext-json: *
- adhocore/cli: ^v0.9.0
- league/event: ^3.0
- league/flysystem: ^1.1.10
Requires (Dev)
- brain/monkey: ^2.0
- mikey179/vfsstream: ^1.6
- phpunit/phpunit: ^7.5 || ^8 || ^9
- wp-media/phpunit: ^3.0
- dev-main
- 3.1.x-dev
- v3.1.0
- v1.x-dev
- v1.1.0
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- v0.0.6
- v0.0.5
- v0.0.4
- v0.0.3
- v0.0.2
- v0.0.1
- dev-fix/30-fix-useless-test-run-generated-in-composer.json
- dev-bug/fix-content-not-present
- dev-bug/fix-classic-to-optimize
- dev-bug/32-no-namespace-should-default
- dev-bug/34-fix-subscriber-generation
- dev-enhancement/27-change-name-terminal
- dev-enhancement/add-event-manager
- dev-bug/fix-v1-bugs
- dev-enhancement/removed-table-command
- dev-enhancement/rename-library
- dev-enhancement/removed-mockery-when-no-need
- dev-enhancement/adapt-to-abstract
- dev-tests/add-integration-tests
- dev-bug/detect-and-remove-default-type
- dev-enhancement/add-external-run
- dev-enhancement/generate-content
- dev-enhancement/add-scenarios
- dev-enhancement/generate-params-fixtures
- dev-enhancement/add-group-test
- dev-enhancement/generate-set-up-logic-for-tests
- dev-enhancement/add-templating-conditions
This package is auto-updated.
Last update: 2025-02-21 23:51:38 UTC
README
Launchpad CLI is the library containing the CLI tool used to generate new files in the Launchpad framework.
Installation
To install the library first launch the following command: composer require launchpad/cli --dev
Then at the root from your project you can create a builder
file with the following content:
#!/usr/bin/php <?php use LaunchpadCLI\AppBuilder; require_once __DIR__ . '/vendor/autoload.php'; AppBuilder::init(__DIR__);
Usage
With this commandline the following command are available:
subscriber
: Generate a subscriber file and attach it to the project.provider
: Generate a service provider file and attach it to the project.test
: Generate a test file.table
: Generate files for adding a new table to the project.fixture
: Generate a fixture file and attach it to the project.
Subscriber
To create a subscriber run the following command: subscriber Namespace/MyClass
.
On the subscriber command the following options are available:
Option | Short option | Value | Short value | Default | Description |
---|---|---|---|---|---|
type | t | common | c | true | Common subscriber that load on both administration view and front |
type | t | admin | a | false | Common subscriber that load only on administration view |
type | t | front | f | false | Common subscriber that load only on front |
Provider
To create a service provider run the following command: provider Namespace/MyClass
.
Test
To create tests matching all public functions from a class run the following command: test Namespace/MyClass
.
To create tests matching a single function from a class run the following commad: test Namespace/MyClass::my_method
.
On the test command the following options are available:
Option | Short option | Value | Short value | Default | Description |
---|---|---|---|---|---|
type | t | both | b | true | Create both unit and integration tests |
type | t | unit | u | false | Create unit tests |
type | t | integration | i | false | Create integration tests |
group | g | your value | your value | false | Add a group to tests |
expected | e | present | p | false | Force the expected parameter on tests |
expected | e | absent | a | false | Force the expected parameter to be absent on tests |
scenarios | s | value1,value2 | value1,value2 | false | Add scenarios to the fixtures from the tests |
external | x | your value | your value | false | Add external run for integration tests |
Table
To create a service provider run the following command: table my_table Mynamespace
.
Fixture
To create a service provider run the following command: fixture MyClass
.