-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathmake-phar.feature
More file actions
58 lines (51 loc) · 1.96 KB
/
make-phar.feature
File metadata and controls
58 lines (51 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Feature: Check `utils/make-phar.php` output
@broken
# TODO: Composer v2 has added a new install-path which references dealerdirect:
# 'install_path' => __DIR__ . '/../dealerdirect/phpcodesniffer-composer-installer',
Scenario: Check autoload stripping of phpcs development classes
Given an empty directory
And a new Phar with the same version
And a custom-cmd.php file:
"""
<?php
WP_CLI::add_command( 'command example', 'Dealerdirect\Composer\Plugin\Installers\PHPCodeSniffer\Plugin' );
"""
When I try `php -derror_log='' {PHAR_PATH} --require=custom-cmd.php help`
Then the return code should be 1
And STDERR should contain:
"""
Error: Callable
"""
And STDERR should not contain:
"""
PHP Warning
"""
And STDOUT should be empty
When I try `grep -a '/dealerdirect\|[^/]/squizlabs(?!/PHP_CodeSniffer/wiki)\|/wimg' {PHAR_PATH}`
Then the return code should be 1
And STDOUT should be empty
And STDERR should be empty
Scenario: Phar renaming affects template path resolution
Given an empty directory
And a new Phar with the same version
And a WP installation
And I run `wp plugin install https://github.com/wp-cli-test/generic-example-plugin/releases/download/v0.1.1/generic-example-plugin.0.1.1.zip --activate`
And I run `wp plugin deactivate generic-example-plugin`
When I run `php {PHAR_PATH} plugin status generic-example-plugin`
Then STDOUT should contain:
"""
Plugin generic-example-plugin details:
Name: Example Plugin
Status: Inactive
Version: 0.1.0
Author: YOUR NAME HERE
Description: PLUGIN DESCRIPTION HERE
"""
And STDERR should be empty
When I run `cp {PHAR_PATH} wp`
And I try `php wp plugin status generic-example-plugin`
Then STDERR should not contain:
"""
Error: Couldn't find plugin-status.mustache
"""
And the return code should be 0