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

Behat files empty after scaffolding #188

Open
chris-odell-focs opened this issue Jun 21, 2019 · 3 comments
Open

Behat files empty after scaffolding #188

chris-odell-focs opened this issue Jun 21, 2019 · 3 comments

Comments

@chris-odell-focs
Copy link

Bug Report

Describe the current, buggy behavior

when running $ wp scaffold package anauthor/test --dir=~/testscaffold or $ wp scaffold package-tests ~/testscaffold --force

I get multiple errors about not not being able to open stream in 'vendor/wp-cli/wp-cli/features/xxx.php

e.g.

'vendor/wp-cli/wp-cli/features/steps/then.php'

And when I look in the folder and open the file it is empty. i.e. the above mentioned file in the features/steps folder is empty.

Describe how other contributors can replicate this bug

  1. Create a folder called 'testscaffold'
  2. run '$ wp scaffold package anauthor/test --dir=~/testscaffold'

Describe what you would expect as the correct outcome

The required behat files to be created

Let us know what environment you are running this on

OS: Linux 4.18.0-21-generic #22~18.04.1-Ubuntu SMP Thu May 16 15:07:19 UTC 2019 x86_64
Shell: /bin/bash
PHP binary: /usr/bin/php7.2
PHP version: 7.2.19-0ubuntu0.18.04.1
php.ini used: /etc/php/7.2/cli/php.ini
WP-CLI root dir: phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir: phar://wp-cli.phar/vendor
WP_CLI phar path: /home/chris
WP-CLI packages dir: /home/chris/.wp-cli/packages/
WP-CLI global config:
WP-CLI project config:
WP-CLI version: 2.2.0

Provide a possible solution

Provide additional context/Screenshots

Success: Created package files in /home/chris/testscaffold
PHP Warning: file_get_contents(phar://wp-cli.phar/vendor/wp-cli/wp-cli/features/bootstrap/FeatureContext.php): failed to open stream: phar error: "vendor/wp-cli/wp-cli/features/bootstrap/FeatureContext.php" is not a file in phar "wp-cli.phar" in /home/chris/.wp-cli/packages/vendor/wp-cli/scaffold-package-command/src/ScaffoldPackageCommand.php on line 684
PHP Warning: file_get_contents(phar://wp-cli.phar/vendor/wp-cli/wp-cli/features/bootstrap/support.php): failed to open stream: phar error: "vendor/wp-cli/wp-cli/features/bootstrap/support.php" is not a file in phar "wp-cli.phar" in /home/chris/.wp-cli/packages/vendor/wp-cli/scaffold-package-command/src/ScaffoldPackageCommand.php on line 684
PHP Warning: file_get_contents(phar://wp-cli.phar/vendor/wp-cli/wp-cli/ci/behat-tags.php): failed to open stream: phar error: "vendor/wp-cli/wp-cli/ci/behat-tags.php" is not a file in phar "wp-cli.phar" in /home/chris/.wp-cli/packages/vendor/wp-cli/scaffold-package-command/src/ScaffoldPackageCommand.php on line 684
PHP Warning: file_get_contents(phar://wp-cli.phar/vendor/wp-cli/wp-cli/features/steps/given.php): failed to open stream: phar error: "vendor/wp-cli/wp-cli/features/steps/given.php" is not a file in phar "wp-cli.phar" in /home/chris/.wp-cli/packages/vendor/wp-cli/scaffold-package-command/src/ScaffoldPackageCommand.php on line 684
PHP Warning: file_get_contents(phar://wp-cli.phar/vendor/wp-cli/wp-cli/features/steps/when.php): failed to open stream: phar error: "vendor/wp-cli/wp-cli/features/steps/when.php" is not a file in phar "wp-cli.phar" in /home/chris/.wp-cli/packages/vendor/wp-cli/scaffold-package-command/src/ScaffoldPackageCommand.php on line 684
PHP Warning: file_get_contents(phar://wp-cli.phar/vendor/wp-cli/wp-cli/features/steps/then.php): failed to open stream: phar error: "vendor/wp-cli/wp-cli/features/steps/then.php" is not a file in phar "wp-cli.phar" in /home/chris/.wp-cli/packages/vendor/wp-cli/scaffold-package-command/src/ScaffoldPackageCommand.php on line 684
PHP Warning: file_get_contents(phar://wp-cli.phar/vendor/wp-cli/wp-cli/features/extra/no-mail.php): failed to open stream: phar error: "vendor/wp-cli/wp-cli/features/extra/no-mail.php" is not a file in phar "wp-cli.phar" in /home/chris/.wp-cli/packages/vendor/wp-cli/scaffold-package-command/src/ScaffoldPackageCommand.php on line 684

@schlessera schlessera added the bug label Jun 25, 2019
@schlessera
Copy link
Member

Thanks for the reminder, the wp-cli/scaffold-package-command still needs a few tweaks to adapt to the current packaging structure.

I'll try to make this a priority.

@chris-odell-focs
Copy link
Author

Cool, let me know when it's done and I will test it. In the meantime the workaround (for anyone else reading this) is simply to copy the missing files from the repo.

Lewiscowles1986 added a commit to Lewiscowles1986/scaffold-package-command that referenced this issue Nov 19, 2020
Fixes wp-cli#188 

Approach:

Modify the file-paths copied

* `wp-cli/wp-cli/ci/behat-tags.php` -> `./utils/behat-tags.php`
* `wp-cli/wp-cli/features/bootstrap/FeatureContext.php` -> `wp-cli/wp-cli-tests/features/bootstrap/FeatureContext.php`
* `wp-cli/wp-cli/features/bootstrap/support.php` -> `wp-cli/wp-cli-tests/features/bootstrap/support.php`
* `wp-cli/wp-cli/features/steps/given.php` -> `wp-cli/wp-cli-tests/features/steps/given.php`
* `wp-cli/wp-cli/features/steps/when.php` -> `wp-cli/wp-cli-tests/features/steps/when.php`
* `wp-cli/wp-cli/features/steps/then.php` -> `wp-cli/wp-cli-tests/features/steps/then.php`
* `wp-cli/wp-cli/features/extra/no-mail.php` -> `wp-cli/wp-cli-tests/features/extra/no-mail.php`
@ernilambar
Copy link
Member

As of WP-CLI version: 2.10.0, I cannot reproduce this issue now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants