Repository navigation
Expand file tree
/
Copy pathmake-phar.feature
More file actions
68 lines (59 loc) 路 2.25 KB
/
Copy pathmake-phar.feature
File metadata and controls
68 lines (59 loc) 路 2.25 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
59
60
61
62
63
64
65
66
67
68
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 get generic-example-plugin --fields=title,status,version,author,description --format=csv`
Then STDOUT should contain:
"""
title,"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 get generic-example-plugin`
Then STDERR should not contain:
"""
Error: Couldn't find plugin-status.mustache
"""
And the return code should be 0
Scenario: Phar is signed with SHA-512
Given an empty directory
And a new Phar with the same version
When I run `cp {PHAR_PATH} signed.phar`
And I run `php -r 'echo (new Phar( "signed.phar" ))->getSignature()["hash_type"];'`
Then STDOUT should be:
"""
SHA-512
"""