From 84410725fbee8f793c12791c9a60039f05f30e83 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Fri, 24 Jan 2025 18:13:17 +0200 Subject: [PATCH 01/20] version bump --- pup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pup b/pup index a337df7..db99929 100755 --- a/pup +++ b/pup @@ -3,7 +3,7 @@ namespace StellarWP\Pup; -const PUP_VERSION = '1.3.8'; +const PUP_VERSION = '1.3.9'; define( '__PUP_DIR__', __DIR__ ); if ( ! \Phar::running() ) { From d96d190bdfe6845d3bf6b7afc3e77e4b6710f7be Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Fri, 24 Jan 2025 18:13:23 +0200 Subject: [PATCH 02/20] docs update --- docs/commands.md | 3 +++ src/Commands/Package.php | 30 +++++--------------------- src/Filesystem/SyncFiles/SyncFiles.php | 13 ++++++++++- 3 files changed, 20 insertions(+), 26 deletions(-) diff --git a/docs/commands.md b/docs/commands.md index ec94b9b..2b0b5dd 100644 --- a/docs/commands.md +++ b/docs/commands.md @@ -257,6 +257,9 @@ src/styles/*.css By default, `pup` will use its own `.distignore-defaults` file to exclude a number of common patterns. You can turn the default exclusion rules off by adding `"zip_use_default_ignore": false` to your `.puprc` file. +If you have a `.distfile` or `.distinclude` in your project, `pup` will NOT use its own `.distignore-defaults` regardless of the +property's `zip_use_default_ignore` value. + The zip that is generated will be placed in your project's root directory. ### Usage diff --git a/src/Commands/Package.php b/src/Commands/Package.php index 9c70804..ca13b9f 100644 --- a/src/Commands/Package.php +++ b/src/Commands/Package.php @@ -85,9 +85,10 @@ protected function execute( InputInterface $input, OutputInterface $output ) { $output->writeln( '- Synchronizing files to zip directory...' ); - $distfiles = $this->getDistfilesLines( $this->getSourceDir( $root ) ); - if ( ! empty( $distfiles ) ) { - $distfiles_message = '>>> Your project has a .distfiles file, so .distignore and pup\'s default ignore rules will not be used.'; + $distfiles = $this->getDistfilesLines( $this->getSourceDir( $root ) ); + $distincludes = $this->getDistincludeLines( $this->getSourceDir( $root ) ); + if ( ! empty( $distfiles ) || ! empty( $distincludes ) ) { + $distfiles_message = '>>> Your project has a .distfiles file or a .distinclude file or both, so pup\'s default ignore rules will not be used.'; $output->writeln( "{$distfiles_message}" ); } @@ -208,22 +209,6 @@ protected function createZip( string $dir_to_zip, string $zip_filename, string $ return 0; } - /** - * Get the default things to exclude from sync. - * - * @return array - */ - public function getDefaultIgnoreLines(): array { - $working_dir = App::getConfig()->getWorkingDir(); - $zip_dir = str_replace( $working_dir, '', App::getConfig()->getZipDir() ); - - return [ - '.puprc', - '.pup-*', - $zip_dir, - ]; - } - /** * Get the files to exclude from sync. * @@ -440,12 +425,7 @@ protected function syncFiles( string $root, string $destination ): int { $distinclude = $this->getDistincludeLines( $source ); $include = array_merge( $distfiles, $distinclude ); - $ignore = $this->getDefaultIgnoreLines(); - - // We only observe .distignore if there is no .distfiles files. - if ( empty( $distfiles ) ) { - $ignore = array_merge( $ignore, $this->getIgnoreLines( $source ) ); - } + $ignore = $this->getIgnoreLines( $source ); $results = $this->migrateNegatedLines( $include, $ignore ); $include = $results['include']; diff --git a/src/Filesystem/SyncFiles/SyncFiles.php b/src/Filesystem/SyncFiles/SyncFiles.php index f9784f4..58fd37c 100644 --- a/src/Filesystem/SyncFiles/SyncFiles.php +++ b/src/Filesystem/SyncFiles/SyncFiles.php @@ -59,7 +59,18 @@ public static function getDistIgnore( string $root, array $paths = [] ): DistIgn $use_ignore_defaults = App::getConfig()->getZipUseDefaultIgnore(); $files = static::getSyncFiles( '.distignore' ); - if ( $use_ignore_defaults ) { + $there_is_safelist = ! empty( + array_filter( + array_unique( + array_merge( + static::getSyncFiles( '.distfiles' ), + static::getSyncFiles( '.distinclude' ) + ) + ) + ) + ); + + if ( ! $there_is_safelist && $use_ignore_defaults ) { $files[] = __PUP_DIR__ . '/.distignore-defaults'; } From 12bec8770b94ce8be5ee64bf53b9b1c96b465972 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Fri, 24 Jan 2025 18:13:36 +0200 Subject: [PATCH 03/20] fix typo --- src/Commands/Package.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Commands/Package.php b/src/Commands/Package.php index ca13b9f..cb24564 100644 --- a/src/Commands/Package.php +++ b/src/Commands/Package.php @@ -272,7 +272,7 @@ public function getDistfilesLines( string $source ): array { */ public function getDistincludeLines( string $source ): array { $include = []; - $include_file = '.pup-include'; + $include_file = '.pup-distinclude'; if ( ! file_exists( $source . $include_file ) ) { return []; From efa7e16d1295c8fcb07903290be0048839513393 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Fri, 24 Jan 2025 18:31:59 +0200 Subject: [PATCH 04/20] update snapshot assertions --- composer.json | 2 +- composer.lock | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/composer.json b/composer.json index 36f6e4a..be81ae1 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "codeception/module-phpbrowser": "^2.0.3", "codeception/module-asserts": "^2.0.1", "codeception/module-cli": "^2.0", - "lucatume/codeception-snapshot-assertions": "^0.2.4" + "lucatume/codeception-snapshot-assertions": "^0.4.0" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index 9e141cb..dc64a6f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "73d426c1e23f213cb7ba8f1660879ade", + "content-hash": "f209922c6af8deb6a753cf87e25cb831", "packages": [ { "name": "composer/ca-bundle", @@ -966,12 +966,12 @@ "version": "v5.2.13", "source": { "type": "git", - "url": "https://github.com/justinrainbow/json-schema.git", + "url": "https://github.com/jsonrainbow/json-schema.git", "reference": "fbbe7e5d79f618997bc3332a6f49246036c45793" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/fbbe7e5d79f618997bc3332a6f49246036c45793", + "url": "https://api.github.com/repos/jsonrainbow/json-schema/zipball/fbbe7e5d79f618997bc3332a6f49246036c45793", "reference": "fbbe7e5d79f618997bc3332a6f49246036c45793", "shasum": "" }, @@ -3327,20 +3327,20 @@ }, { "name": "lucatume/codeception-snapshot-assertions", - "version": "0.2.4", + "version": "0.4.0", "source": { "type": "git", "url": "https://github.com/lucatume/codeception-snapshot-assertions.git", - "reference": "077108237a121d3ddcf7070aa8519dea25459a6a" + "reference": "dd231b17a4a7f74e33a27749edab64688e3ecc2b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/lucatume/codeception-snapshot-assertions/zipball/077108237a121d3ddcf7070aa8519dea25459a6a", - "reference": "077108237a121d3ddcf7070aa8519dea25459a6a", + "url": "https://api.github.com/repos/lucatume/codeception-snapshot-assertions/zipball/dd231b17a4a7f74e33a27749edab64688e3ecc2b", + "reference": "dd231b17a4a7f74e33a27749edab64688e3ecc2b", "shasum": "" }, "require": { - "codeception/codeception": "^2.5 || ^3.0 || ^4.0", + "codeception/codeception": "^4.0", "ext-dom": "*", "gajus/dindent": "^2.0" }, @@ -3366,9 +3366,9 @@ "description": "Snapshot assertions sugar for Codeception.", "support": { "issues": "https://github.com/lucatume/codeception-snapshot-assertions/issues", - "source": "https://github.com/lucatume/codeception-snapshot-assertions/tree/master" + "source": "https://github.com/lucatume/codeception-snapshot-assertions/tree/0.4.0" }, - "time": "2020-02-05T20:17:49+00:00" + "time": "2023-10-14T14:42:12+00:00" }, { "name": "myclabs/deep-copy", @@ -5599,12 +5599,12 @@ ], "aliases": [], "minimum-stability": "dev", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": true, "prefer-lowest": false, "platform": { "php": "^7.2|^8.0" }, - "platform-dev": [], + "platform-dev": {}, "plugin-api-version": "2.6.0" } From c204ceef551f5f0ae0e0076d82af13bd15c43548 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Fri, 24 Jan 2025 18:32:08 +0200 Subject: [PATCH 05/20] add more test data --- tests/_data/fake-project/node_modules/a-script-i-need.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 tests/_data/fake-project/node_modules/a-script-i-need.js diff --git a/tests/_data/fake-project/node_modules/a-script-i-need.js b/tests/_data/fake-project/node_modules/a-script-i-need.js new file mode 100644 index 0000000..e69de29 From eede9e222d3490bd120cbae2e17e37532d8f864d Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Fri, 24 Jan 2025 18:32:17 +0200 Subject: [PATCH 06/20] update snapshots --- .../__snapshots__/BuildCest__it_should_run_build__0.snapshot.txt | 1 + ...est__it_should_run_build_with_custom_env_vars__0.snapshot.txt | 1 + ...st__it_should_run_build_with_default_env_vars__0.snapshot.txt | 1 + 3 files changed, 3 insertions(+) diff --git a/tests/cli/Commands/__snapshots__/BuildCest__it_should_run_build__0.snapshot.txt b/tests/cli/Commands/__snapshots__/BuildCest__it_should_run_build__0.snapshot.txt index a02c5e8..cfc0167 100644 --- a/tests/cli/Commands/__snapshots__/BuildCest__it_should_run_build__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/BuildCest__it_should_run_build__0.snapshot.txt @@ -7,6 +7,7 @@ Running build steps... .. .puprc bootstrap.php +node_modules other-file.php package.json src diff --git a/tests/cli/Commands/__snapshots__/BuildCest__it_should_run_build_with_custom_env_vars__0.snapshot.txt b/tests/cli/Commands/__snapshots__/BuildCest__it_should_run_build_with_custom_env_vars__0.snapshot.txt index 6bc0203..252e631 100644 --- a/tests/cli/Commands/__snapshots__/BuildCest__it_should_run_build_with_custom_env_vars__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/BuildCest__it_should_run_build_with_custom_env_vars__0.snapshot.txt @@ -7,6 +7,7 @@ Running build steps... .. .puprc bootstrap.php +node_modules other-file.php package.json src diff --git a/tests/cli/Commands/__snapshots__/BuildCest__it_should_run_build_with_default_env_vars__0.snapshot.txt b/tests/cli/Commands/__snapshots__/BuildCest__it_should_run_build_with_default_env_vars__0.snapshot.txt index 37a6158..46e108b 100644 --- a/tests/cli/Commands/__snapshots__/BuildCest__it_should_run_build_with_default_env_vars__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/BuildCest__it_should_run_build_with_default_env_vars__0.snapshot.txt @@ -7,6 +7,7 @@ Running build steps... .. .puprc bootstrap.php +node_modules other-file.php package.json src From c9f2a8fbf13ca85cadb006d366a0534351be0cdb Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Fri, 24 Jan 2025 18:33:49 +0200 Subject: [PATCH 07/20] update more snapshots --- ...age_the_zip_and_ignore_files_from_defaults__0.snapshot.txt | 2 ++ ...e_the_zip_and_ignore_files_from_distignore__0.snapshot.txt | 1 + ...re_files_from_distignore_and_gitattributes__0.snapshot.txt | 1 + ...he_zip_and_ignore_files_from_gitattributes__0.snapshot.txt | 3 +++ ...l_arguments_and_options_to_workflow_script__0.snapshot.txt | 2 +- ...kflowCest__it_should_run_build_as_workflow__0.snapshot.txt | 1 + ...zip_with_repo_using_file_colon_slash_slash__0.snapshot.txt | 1 + ...ipCest__it_should_zip_with_repo_using_path__0.snapshot.txt | 1 + .../ZipCest__it_should_zip_without_cloning__0.snapshot.txt | 4 ++-- ...thout_running_checks_when_checks_are_empty__0.snapshot.txt | 4 ++-- 10 files changed, 15 insertions(+), 5 deletions(-) diff --git a/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_ignore_files_from_defaults__0.snapshot.txt b/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_ignore_files_from_defaults__0.snapshot.txt index ace89d8..c235e9e 100644 --- a/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_ignore_files_from_defaults__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_ignore_files_from_defaults__0.snapshot.txt @@ -2,5 +2,7 @@ .. bootstrap.php fake-project +node_modules other-file.php +package.json src \ No newline at end of file diff --git a/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_ignore_files_from_distignore__0.snapshot.txt b/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_ignore_files_from_distignore__0.snapshot.txt index f9b9368..21adcb2 100644 --- a/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_ignore_files_from_distignore__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_ignore_files_from_distignore__0.snapshot.txt @@ -2,6 +2,7 @@ .. .distignore fake-project +node_modules other-file.php package.json src \ No newline at end of file diff --git a/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_ignore_files_from_distignore_and_gitattributes__0.snapshot.txt b/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_ignore_files_from_distignore_and_gitattributes__0.snapshot.txt index 408b42b..5f5f62b 100644 --- a/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_ignore_files_from_distignore_and_gitattributes__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_ignore_files_from_distignore_and_gitattributes__0.snapshot.txt @@ -3,5 +3,6 @@ .distignore .gitattributes fake-project +node_modules package.json src \ No newline at end of file diff --git a/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_ignore_files_from_gitattributes__0.snapshot.txt b/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_ignore_files_from_gitattributes__0.snapshot.txt index 3f11399..9f42632 100644 --- a/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_ignore_files_from_gitattributes__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_ignore_files_from_gitattributes__0.snapshot.txt @@ -1,5 +1,8 @@ . .. +.gitattributes fake-project +node_modules other-file.php +package.json src \ No newline at end of file diff --git a/tests/cli/Commands/__snapshots__/WorkflowCest__it_should_pass_additional_arguments_and_options_to_workflow_script__0.snapshot.txt b/tests/cli/Commands/__snapshots__/WorkflowCest__it_should_pass_additional_arguments_and_options_to_workflow_script__0.snapshot.txt index 6a023a0..43fb438 100644 --- a/tests/cli/Commands/__snapshots__/WorkflowCest__it_should_pass_additional_arguments_and_options_to_workflow_script__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/WorkflowCest__it_should_pass_additional_arguments_and_options_to_workflow_script__0.snapshot.txt @@ -8,4 +8,4 @@ Argument: arg2 Option: --option-one, Value: one Option: --option-two, Value: two -Workflow complete. +Workflow complete. \ No newline at end of file diff --git a/tests/cli/Commands/__snapshots__/WorkflowCest__it_should_run_build_as_workflow__0.snapshot.txt b/tests/cli/Commands/__snapshots__/WorkflowCest__it_should_run_build_as_workflow__0.snapshot.txt index b077de2..1817700 100644 --- a/tests/cli/Commands/__snapshots__/WorkflowCest__it_should_run_build_as_workflow__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/WorkflowCest__it_should_run_build_as_workflow__0.snapshot.txt @@ -7,6 +7,7 @@ Running build workflow steps... .. .puprc bootstrap.php +node_modules other-file.php package.json src diff --git a/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_with_repo_using_file_colon_slash_slash__0.snapshot.txt b/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_with_repo_using_file_colon_slash_slash__0.snapshot.txt index 58ae076..29bfc29 100644 --- a/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_with_repo_using_file_colon_slash_slash__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_with_repo_using_file_colon_slash_slash__0.snapshot.txt @@ -9,6 +9,7 @@ Running build steps... .. .git bootstrap.php +node_modules other-file.php package.json src diff --git a/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_with_repo_using_path__0.snapshot.txt b/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_with_repo_using_path__0.snapshot.txt index b5af0b3..85c9f58 100644 --- a/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_with_repo_using_path__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_with_repo_using_path__0.snapshot.txt @@ -9,6 +9,7 @@ Running build steps... .. .git bootstrap.php +node_modules other-file.php package.json src diff --git a/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_without_cloning__0.snapshot.txt b/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_without_cloning__0.snapshot.txt index 9b5f7bb..96e746f 100644 --- a/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_without_cloning__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_without_cloning__0.snapshot.txt @@ -7,6 +7,7 @@ Running build steps... .. .puprc bootstrap.php +node_modules other-file.php package.json src @@ -43,5 +44,4 @@ Cleaning up... -------------- ✓ Removing zip dir...Complete. -✓ Removing build dir...Complete. -✓ Removing .pup-distignore...Complete. \ No newline at end of file +✓ Removing build dir...Complete. \ No newline at end of file diff --git a/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_without_running_checks_when_checks_are_empty__0.snapshot.txt b/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_without_running_checks_when_checks_are_empty__0.snapshot.txt index 139afa2..d163559 100644 --- a/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_without_running_checks_when_checks_are_empty__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_without_running_checks_when_checks_are_empty__0.snapshot.txt @@ -7,6 +7,7 @@ Running build steps... .. .puprc bootstrap.php +node_modules other-file.php package.json src @@ -30,5 +31,4 @@ Cleaning up... -------------- ✓ Removing zip dir...Complete. -✓ Removing build dir...Complete. -✓ Removing .pup-distignore...Complete. \ No newline at end of file +✓ Removing build dir...Complete. \ No newline at end of file From 542612c60ee677028479d04a6cc47602168a60cd Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Fri, 24 Jan 2025 18:35:13 +0200 Subject: [PATCH 08/20] update snapshots --- ...hould_run_fail_tbd_check_when_tbds_exist__0.snapshot.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/cli/Commands/Checks/__snapshots__/TbdCest__it_should_run_fail_tbd_check_when_tbds_exist__0.snapshot.txt b/tests/cli/Commands/Checks/__snapshots__/TbdCest__it_should_run_fail_tbd_check_when_tbds_exist__0.snapshot.txt index 695f409..6dfa347 100644 --- a/tests/cli/Commands/Checks/__snapshots__/TbdCest__it_should_run_fail_tbd_check_when_tbds_exist__0.snapshot.txt +++ b/tests/cli/Commands/Checks/__snapshots__/TbdCest__it_should_run_fail_tbd_check_when_tbds_exist__0.snapshot.txt @@ -2,6 +2,9 @@ Checking for TBDs... -------------------- +./src/Plugin.php +9: * @since TBD + ./src/Thing/AnotherFile.php 5: _deprecated_file( __FILE__, 'TBD' ); 9: * @since TBD @@ -11,8 +14,5 @@ Checking for TBDs... 28: * @deprecated TBD 32: _deprecated_function( __METHOD__, 'TBD' ); -./src/Plugin.php -9: * @since TBD - TBDs have been found! \ No newline at end of file From 917e0f89b953db1f2b0ae7fb0c2854c5eb46b8fc Mon Sep 17 00:00:00 2001 From: Fake Fake Date: Fri, 24 Jan 2025 18:50:32 +0200 Subject: [PATCH 09/20] update snapshots --- tests/cli/AbstractBase.php | 2 ++ tests/cli/Commands/CloneCest.php | 4 ++-- tests/cli/Commands/InfoCest.php | 12 ++++++------ tests/cli/Commands/WorkflowCest.php | 3 +-- tests/cli/Commands/ZipCest.php | 6 ++---- ...e_a_specific_branch_of_a_git_repo__0.snapshot.txt | 2 +- ..._the_default_branch_of_a_git_repo__0.snapshot.txt | 2 +- .../InfoCest__it_should_provide_info__0.snapshot.txt | 4 ++-- ...ould_provide_info_with_distignore__0.snapshot.txt | 4 ++-- ...uld_provide_info_with_distinclude__0.snapshot.txt | 4 ++-- ...d_provide_info_with_gitattributes__0.snapshot.txt | 4 ++-- ...it_should_provide_info_with_puprc__0.snapshot.txt | 4 ++-- ...est__it_should_show_invalid_puprc__0.snapshot.txt | 4 ++-- ...ts_and_options_to_workflow_script__0.snapshot.txt | 2 +- ...repo_using_file_colon_slash_slash__0.snapshot.txt | 2 +- ...t_should_zip_with_repo_using_path__0.snapshot.txt | 2 +- 16 files changed, 30 insertions(+), 31 deletions(-) diff --git a/tests/cli/AbstractBase.php b/tests/cli/AbstractBase.php index eee6148..431f49a 100644 --- a/tests/cli/AbstractBase.php +++ b/tests/cli/AbstractBase.php @@ -9,11 +9,13 @@ class AbstractBase { protected $pup; protected $pup_root; + protected $plugin_root; protected $tests_root; public function __construct() { $this->tests_root = dirname( __DIR__ ); $this->pup_root = dirname( $this->tests_root ); + $this->plugin_root = dirname( $this->pup_root ); } public function _before( CliTester $I ) { diff --git a/tests/cli/Commands/CloneCest.php b/tests/cli/Commands/CloneCest.php index 52bffd4..43efb47 100644 --- a/tests/cli/Commands/CloneCest.php +++ b/tests/cli/Commands/CloneCest.php @@ -33,7 +33,7 @@ public function it_should_clone_the_default_branch_of_a_git_repo( CliTester $I ) $I->assertTrue( file_exists( '.pup-build/bootstrap.php' ) ); $output = $I->grabShellOutput(); - $this->assertMatchesStringSnapshot( $output ); + $this->assertMatchesStringSnapshot( str_replace( $this->plugin_root, '{PUP_ROOT}', $output ) ); $I->runShellCommand( "php {$this->pup} clean" ); @@ -72,7 +72,7 @@ public function it_should_clone_a_specific_branch_of_a_git_repo( CliTester $I ) $I->assertTrue( file_exists( '.pup-build/new-file.txt' ) ); $output = $I->grabShellOutput(); - $this->assertMatchesStringSnapshot( $output ); + $this->assertMatchesStringSnapshot( str_replace( $this->plugin_root, '{PUP_ROOT}', $output ) ); $I->runShellCommand( "php {$this->pup} clean" ); diff --git a/tests/cli/Commands/InfoCest.php b/tests/cli/Commands/InfoCest.php index c0286bf..5fb9a83 100644 --- a/tests/cli/Commands/InfoCest.php +++ b/tests/cli/Commands/InfoCest.php @@ -23,7 +23,7 @@ public function it_should_provide_info( CliTester $I ) { $I->runShellCommand( "php {$this->pup} info" ); $I->seeResultCodeIs( 0 ); - $output = $this->removeDynamicDataFromOutput( $I->grabShellOutput() ); + $output = $this->removeDynamicDataFromOutput( str_replace( $this->plugin_root, '{PUP_ROOT}', $I->grabShellOutput() ) ); $this->assertMatchesStringSnapshot( $output ); } @@ -39,7 +39,7 @@ public function it_should_provide_info_with_puprc( CliTester $I ) { $I->runShellCommand( "php {$this->pup} info" ); $I->seeResultCodeIs( 0 ); - $output = $this->removeDynamicDataFromOutput( $I->grabShellOutput() ); + $output = $this->removeDynamicDataFromOutput( str_replace( $this->plugin_root, '{PUP_ROOT}', $I->grabShellOutput() ) ); $this->assertMatchesStringSnapshot( $output ); } @@ -55,7 +55,7 @@ public function it_should_provide_info_with_distignore( CliTester $I ) { $I->runShellCommand( "php {$this->pup} info" ); $I->seeResultCodeIs( 0 ); - $output = $this->removeDynamicDataFromOutput( $I->grabShellOutput() ); + $output = $this->removeDynamicDataFromOutput( str_replace( $this->plugin_root, '{PUP_ROOT}', $I->grabShellOutput() ) ); $this->assertMatchesStringSnapshot( $output ); @@ -73,7 +73,7 @@ public function it_should_provide_info_with_distinclude( CliTester $I ) { $I->runShellCommand( "php {$this->pup} info" ); $I->seeResultCodeIs( 0 ); - $output = $this->removeDynamicDataFromOutput( $I->grabShellOutput() ); + $output = $this->removeDynamicDataFromOutput( str_replace( $this->plugin_root, '{PUP_ROOT}', $I->grabShellOutput() ) ); $this->assertMatchesStringSnapshot( $output ); @@ -91,7 +91,7 @@ public function it_should_provide_info_with_gitattributes( CliTester $I ) { $I->runShellCommand( "php {$this->pup} info" ); $I->seeResultCodeIs( 0 ); - $output = $this->removeDynamicDataFromOutput( $I->grabShellOutput() ); + $output = $this->removeDynamicDataFromOutput( str_replace( $this->plugin_root, '{PUP_ROOT}', $I->grabShellOutput() ) ); $this->assertMatchesStringSnapshot( $output ); @@ -111,7 +111,7 @@ public function it_should_show_invalid_puprc( CliTester $I ) { $I->runShellCommand( "php {$this->pup} info" ); $I->seeResultCodeIs( 0 ); - $output = $this->removeDynamicDataFromOutput( $I->grabShellOutput() ); + $output = $this->removeDynamicDataFromOutput( str_replace( $this->plugin_root, '{PUP_ROOT}', $I->grabShellOutput() ) ); $this->assertMatchesStringSnapshot( $output ); } diff --git a/tests/cli/Commands/WorkflowCest.php b/tests/cli/Commands/WorkflowCest.php index 5f9357a..28dc9a4 100644 --- a/tests/cli/Commands/WorkflowCest.php +++ b/tests/cli/Commands/WorkflowCest.php @@ -190,7 +190,6 @@ public function it_should_pass_additional_arguments_and_options_to_workflow_scri $I->seeInShellOutput( 'Option: --option-one, Value: one' ); $I->seeInShellOutput( 'Option: --option-two, Value: two' ); - $output = $I->grabShellOutput(); - $this->assertMatchesStringSnapshot( $output ); + $this->assertMatchesStringSnapshot( str_replace( $this->plugin_root, '{PUP_ROOT}', $I->grabShellOutput() ) ); } } diff --git a/tests/cli/Commands/ZipCest.php b/tests/cli/Commands/ZipCest.php index da7fdb1..c15d014 100644 --- a/tests/cli/Commands/ZipCest.php +++ b/tests/cli/Commands/ZipCest.php @@ -33,8 +33,7 @@ public function it_should_zip_with_repo_using_path( CliTester $I ) { $I->assertTrue( file_exists( 'fake-project.1.0.0.1.zip' ) ); - $output = $I->grabShellOutput(); - $this->assertMatchesStringSnapshot( $output ); + $this->assertMatchesStringSnapshot( str_replace( $this->plugin_root, '{PUP_ROOT}', $I->grabShellOutput() ) ); $I->runShellCommand( "php {$this->pup} clean" ); @@ -68,8 +67,7 @@ public function it_should_zip_with_repo_using_file_colon_slash_slash( CliTester $I->assertTrue( file_exists( 'fake-project.1.0.0.1.zip' ) ); - $output = $I->grabShellOutput(); - $this->assertMatchesStringSnapshot( $output ); + $this->assertMatchesStringSnapshot( str_replace( $this->plugin_root, '{PUP_ROOT}', $I->grabShellOutput() ) ); $I->runShellCommand( "php {$this->pup} clean" ); diff --git a/tests/cli/Commands/__snapshots__/CloneCest__it_should_clone_a_specific_branch_of_a_git_repo__0.snapshot.txt b/tests/cli/Commands/__snapshots__/CloneCest__it_should_clone_a_specific_branch_of_a_git_repo__0.snapshot.txt index 0d0b2b5..20290ae 100644 --- a/tests/cli/Commands/__snapshots__/CloneCest__it_should_clone_a_specific_branch_of_a_git_repo__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/CloneCest__it_should_clone_a_specific_branch_of_a_git_repo__0.snapshot.txt @@ -1,2 +1,2 @@ -Cloning the /var/www/html/wp-content/plugins/pup/tests/_data/fake-project-git-repo repo into .pup-build... +Cloning the {PUP_ROOT}/pup/tests/_data/fake-project-git-repo repo into .pup-build... ✓ Clone complete. \ No newline at end of file diff --git a/tests/cli/Commands/__snapshots__/CloneCest__it_should_clone_the_default_branch_of_a_git_repo__0.snapshot.txt b/tests/cli/Commands/__snapshots__/CloneCest__it_should_clone_the_default_branch_of_a_git_repo__0.snapshot.txt index 0d0b2b5..20290ae 100644 --- a/tests/cli/Commands/__snapshots__/CloneCest__it_should_clone_the_default_branch_of_a_git_repo__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/CloneCest__it_should_clone_the_default_branch_of_a_git_repo__0.snapshot.txt @@ -1,2 +1,2 @@ -Cloning the /var/www/html/wp-content/plugins/pup/tests/_data/fake-project-git-repo repo into .pup-build... +Cloning the {PUP_ROOT}/pup/tests/_data/fake-project-git-repo repo into .pup-build... ✓ Clone complete. \ No newline at end of file diff --git a/tests/cli/Commands/__snapshots__/InfoCest__it_should_provide_info__0.snapshot.txt b/tests/cli/Commands/__snapshots__/InfoCest__it_should_provide_info__0.snapshot.txt index ec708e2..01429f5 100644 --- a/tests/cli/Commands/__snapshots__/InfoCest__it_should_provide_info__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/InfoCest__it_should_provide_info__0.snapshot.txt @@ -2,13 +2,13 @@ CLI Info ======== -pup from /var/www/html/wp-content/plugins/pup/pup +pup from {PUP_ROOT}/pup/pup Using: PHP Working Directory ----------------- -/var/www/html/wp-content/plugins/pup/tests/_data/fake-project/ +{PUP_ROOT}/pup/tests/_data/fake-project/ File info --------- diff --git a/tests/cli/Commands/__snapshots__/InfoCest__it_should_provide_info_with_distignore__0.snapshot.txt b/tests/cli/Commands/__snapshots__/InfoCest__it_should_provide_info_with_distignore__0.snapshot.txt index 299eaca..1644cb3 100644 --- a/tests/cli/Commands/__snapshots__/InfoCest__it_should_provide_info_with_distignore__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/InfoCest__it_should_provide_info_with_distignore__0.snapshot.txt @@ -2,13 +2,13 @@ CLI Info ======== -pup from /var/www/html/wp-content/plugins/pup/pup +pup from {PUP_ROOT}/pup/pup Using: PHP Working Directory ----------------- -/var/www/html/wp-content/plugins/pup/tests/_data/fake-project/ +{PUP_ROOT}/pup/tests/_data/fake-project/ File info --------- diff --git a/tests/cli/Commands/__snapshots__/InfoCest__it_should_provide_info_with_distinclude__0.snapshot.txt b/tests/cli/Commands/__snapshots__/InfoCest__it_should_provide_info_with_distinclude__0.snapshot.txt index 2fa4f89..901ba92 100644 --- a/tests/cli/Commands/__snapshots__/InfoCest__it_should_provide_info_with_distinclude__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/InfoCest__it_should_provide_info_with_distinclude__0.snapshot.txt @@ -2,13 +2,13 @@ CLI Info ======== -pup from /var/www/html/wp-content/plugins/pup/pup +pup from {PUP_ROOT}/pup/pup Using: PHP Working Directory ----------------- -/var/www/html/wp-content/plugins/pup/tests/_data/fake-project/ +{PUP_ROOT}/pup/tests/_data/fake-project/ File info --------- diff --git a/tests/cli/Commands/__snapshots__/InfoCest__it_should_provide_info_with_gitattributes__0.snapshot.txt b/tests/cli/Commands/__snapshots__/InfoCest__it_should_provide_info_with_gitattributes__0.snapshot.txt index 71cb830..a40f3bf 100644 --- a/tests/cli/Commands/__snapshots__/InfoCest__it_should_provide_info_with_gitattributes__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/InfoCest__it_should_provide_info_with_gitattributes__0.snapshot.txt @@ -2,13 +2,13 @@ CLI Info ======== -pup from /var/www/html/wp-content/plugins/pup/pup +pup from {PUP_ROOT}/pup/pup Using: PHP Working Directory ----------------- -/var/www/html/wp-content/plugins/pup/tests/_data/fake-project/ +{PUP_ROOT}/pup/tests/_data/fake-project/ File info --------- diff --git a/tests/cli/Commands/__snapshots__/InfoCest__it_should_provide_info_with_puprc__0.snapshot.txt b/tests/cli/Commands/__snapshots__/InfoCest__it_should_provide_info_with_puprc__0.snapshot.txt index 016f3e6..5feacc9 100644 --- a/tests/cli/Commands/__snapshots__/InfoCest__it_should_provide_info_with_puprc__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/InfoCest__it_should_provide_info_with_puprc__0.snapshot.txt @@ -2,13 +2,13 @@ CLI Info ======== -pup from /var/www/html/wp-content/plugins/pup/pup +pup from {PUP_ROOT}/pup/pup Using: PHP Working Directory ----------------- -/var/www/html/wp-content/plugins/pup/tests/_data/fake-project/ +{PUP_ROOT}/pup/tests/_data/fake-project/ File info --------- diff --git a/tests/cli/Commands/__snapshots__/InfoCest__it_should_show_invalid_puprc__0.snapshot.txt b/tests/cli/Commands/__snapshots__/InfoCest__it_should_show_invalid_puprc__0.snapshot.txt index a600e32..e5cd9c7 100644 --- a/tests/cli/Commands/__snapshots__/InfoCest__it_should_show_invalid_puprc__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/InfoCest__it_should_show_invalid_puprc__0.snapshot.txt @@ -2,13 +2,13 @@ CLI Info ======== -pup from /var/www/html/wp-content/plugins/pup/pup +pup from {PUP_ROOT}/pup/pup Using: PHP Working Directory ----------------- -/var/www/html/wp-content/plugins/pup/tests/_data/fake-project/ +{PUP_ROOT}/pup/tests/_data/fake-project/ File info --------- diff --git a/tests/cli/Commands/__snapshots__/WorkflowCest__it_should_pass_additional_arguments_and_options_to_workflow_script__0.snapshot.txt b/tests/cli/Commands/__snapshots__/WorkflowCest__it_should_pass_additional_arguments_and_options_to_workflow_script__0.snapshot.txt index 43fb438..3d3741a 100644 --- a/tests/cli/Commands/__snapshots__/WorkflowCest__it_should_pass_additional_arguments_and_options_to_workflow_script__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/WorkflowCest__it_should_pass_additional_arguments_and_options_to_workflow_script__0.snapshot.txt @@ -1,6 +1,6 @@ Running test-workflow workflow steps... -> /var/www/html/wp-content/plugins/pup/tests/_data/test-workflow-script.sh 'arg1' 'arg2' '--option-one=one' '--option-two=two' +> {PUP_ROOT}/pup/tests/_data/test-workflow-script.sh 'arg1' 'arg2' '--option-one=one' '--option-two=two' ------------------------------------------------------------------------------------------------------------------------------ Argument: arg1 diff --git a/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_with_repo_using_file_colon_slash_slash__0.snapshot.txt b/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_with_repo_using_file_colon_slash_slash__0.snapshot.txt index 29bfc29..4993696 100644 --- a/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_with_repo_using_file_colon_slash_slash__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_with_repo_using_file_colon_slash_slash__0.snapshot.txt @@ -1,4 +1,4 @@ -Cloning the file:///var/www/html/wp-content/plugins/pup/tests/_data/fake-project-git-repo repo into .pup-build... +Cloning the file://{PUP_ROOT}/pup/tests/_data/fake-project-git-repo repo into .pup-build... ✓ Clone complete. Running build steps... diff --git a/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_with_repo_using_path__0.snapshot.txt b/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_with_repo_using_path__0.snapshot.txt index 85c9f58..fb4f4b5 100644 --- a/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_with_repo_using_path__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_with_repo_using_path__0.snapshot.txt @@ -1,4 +1,4 @@ -Cloning the /var/www/html/wp-content/plugins/pup/tests/_data/fake-project-git-repo repo into .pup-build... +Cloning the {PUP_ROOT}/pup/tests/_data/fake-project-git-repo repo into .pup-build... ✓ Clone complete. Running build steps... From c190d661c91107c15f1641885c35a9836b16f617 Mon Sep 17 00:00:00 2001 From: Fake Fake Date: Fri, 24 Jan 2025 17:10:42 +0000 Subject: [PATCH 10/20] Initial commit --- ...ude_even_if_in_distignore_and_gitattributes__0.snapshot.txt | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_include_files_in_distinclude_even_if_in_distignore_and_gitattributes__0.snapshot.txt diff --git a/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_include_files_in_distinclude_even_if_in_distignore_and_gitattributes__0.snapshot.txt b/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_include_files_in_distinclude_even_if_in_distignore_and_gitattributes__0.snapshot.txt deleted file mode 100644 index b039e05..0000000 --- a/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_include_files_in_distinclude_even_if_in_distignore_and_gitattributes__0.snapshot.txt +++ /dev/null @@ -1,3 +0,0 @@ -. -.. -fake-project \ No newline at end of file From f9e7517af9da4374edc12321c3620cfdc4ab1f80 Mon Sep 17 00:00:00 2001 From: Fake Fake Date: Fri, 24 Jan 2025 19:12:45 +0200 Subject: [PATCH 11/20] adding test coverage --- tests/cli/AbstractBase.php | 2 + tests/cli/Commands/PackageCest.php | 110 ++++++++++-------- ...include_files_in_distfiles__0.snapshot.txt | 6 + ...and_ignore_from_distignore__0.snapshot.txt | 11 ++ ...stignore_and_gitattributes__0.snapshot.txt | 4 + 5 files changed, 84 insertions(+), 49 deletions(-) create mode 100644 tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_include_files_in_distfiles__0.snapshot.txt create mode 100644 tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_include_files_in_distfiles_and_ignore_from_distignore__0.snapshot.txt create mode 100644 tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_not_include_files_in_distinclude_even_if_in_distignore_and_gitattributes__0.snapshot.txt diff --git a/tests/cli/AbstractBase.php b/tests/cli/AbstractBase.php index 431f49a..0451abf 100644 --- a/tests/cli/AbstractBase.php +++ b/tests/cli/AbstractBase.php @@ -24,6 +24,7 @@ public function _before( CliTester $I ) { } public function _after( CliTester $I ) { + $I->runShellCommand( "php {$this->pup} clean" ); $this->reset_data_and_location(); } @@ -33,6 +34,7 @@ protected function reset_data_and_location() { '.puprc', '.distignore', '.distinclude', + '.distfiles', '.gitattributes', 'fake-project.1.0.0.zip', 'fake-project.1.0.0.1.zip', diff --git a/tests/cli/Commands/PackageCest.php b/tests/cli/Commands/PackageCest.php index 9f94fd9..1d18726 100644 --- a/tests/cli/Commands/PackageCest.php +++ b/tests/cli/Commands/PackageCest.php @@ -6,27 +6,11 @@ use StellarWP\Pup\Tests\CliTester; class PackageCest extends AbstractBase { - protected function reset_data_and_location() { - chdir( __DIR__ ); - $files = [ - '.puprc', - '.distignore', - '.distinclude', - '.gitattributes', - 'fake-project.1.0.0.zip', - 'fake-project.zip', - ]; - - foreach ( $files as $file ) { - @unlink( $this->tests_root . '/_data/fake-project/' . $file ); - } - } /** * @test */ public function it_should_package_the_zip( CliTester $I ) { - $this->reset_data_and_location(); $this->write_default_puprc(); chdir( $this->tests_root . '/_data/fake-project' ); @@ -38,16 +22,12 @@ public function it_should_package_the_zip( CliTester $I ) { $output = $I->grabShellOutput(); $this->assertMatchesStringSnapshot( $output ); - - $I->runShellCommand( "php {$this->pup} clean" ); - $this->reset_data_and_location(); } /** * @test */ public function it_should_package_the_zip_without_version_number_if_unknown( CliTester $I ) { - $this->reset_data_and_location(); $this->write_default_puprc(); chdir( $this->tests_root . '/_data/fake-project' ); @@ -59,16 +39,12 @@ public function it_should_package_the_zip_without_version_number_if_unknown( Cli $output = $I->grabShellOutput(); $this->assertMatchesStringSnapshot( $output ); - - $I->runShellCommand( "php {$this->pup} clean" ); - $this->reset_data_and_location(); } /** * @test */ public function it_should_package_the_zip_and_ignore_files_from_defaults( CliTester $I ) { - $this->reset_data_and_location(); $this->write_default_puprc(); chdir( $this->tests_root . '/_data/fake-project' ); @@ -81,16 +57,12 @@ public function it_should_package_the_zip_and_ignore_files_from_defaults( CliTes $output = $I->grabShellOutput(); $this->assertMatchesStringSnapshot( $output ); - - $I->runShellCommand( "php {$this->pup} clean" ); - $this->reset_data_and_location(); } /** * @test */ public function it_should_package_the_zip_and_ignore_files_from_distignore( CliTester $I ) { - $this->reset_data_and_location(); $this->write_default_puprc(); chdir( $this->tests_root . '/_data/fake-project' ); @@ -105,16 +77,12 @@ public function it_should_package_the_zip_and_ignore_files_from_distignore( CliT $output = $I->grabShellOutput(); $this->assertMatchesStringSnapshot( $output ); - - $I->runShellCommand( "php {$this->pup} clean" ); - $this->reset_data_and_location(); } /** * @test */ public function it_should_package_the_zip_and_ignore_files_from_gitattributes( CliTester $I ) { - $this->reset_data_and_location(); $this->write_default_puprc(); chdir( $this->tests_root . '/_data/fake-project' ); @@ -129,16 +97,12 @@ public function it_should_package_the_zip_and_ignore_files_from_gitattributes( C $output = $I->grabShellOutput(); $this->assertMatchesStringSnapshot( $output ); - - $I->runShellCommand( "php {$this->pup} clean" ); - $this->reset_data_and_location(); } /** * @test */ public function it_should_package_the_zip_and_ignore_files_from_distignore_and_gitattributes( CliTester $I ) { - $this->reset_data_and_location(); $this->write_default_puprc(); chdir( $this->tests_root . '/_data/fake-project' ); @@ -154,16 +118,12 @@ public function it_should_package_the_zip_and_ignore_files_from_distignore_and_g $output = $I->grabShellOutput(); $this->assertMatchesStringSnapshot( $output ); - - $I->runShellCommand( "php {$this->pup} clean" ); - $this->reset_data_and_location(); } /** * @test */ public function it_should_package_the_zip_and_include_files_in_distinclude( CliTester $I ) { - $this->reset_data_and_location(); $this->write_default_puprc(); chdir( $this->tests_root . '/_data/fake-project' ); @@ -178,23 +138,45 @@ public function it_should_package_the_zip_and_include_files_in_distinclude( CliT $output = $I->grabShellOutput(); $this->assertMatchesStringSnapshot( $output ); + } + + /** + * @test + */ + public function it_should_package_the_zip_and_include_files_in_distfiles( CliTester $I ) { + $this->write_default_puprc(); + + chdir( $this->tests_root . '/_data/fake-project' ); + + file_put_contents( '.distfiles', "/node_modules/a-script-i-need.js\n" ); + + $I->runShellCommand( "php {$this->pup} package 1.0.0" ); + + system( 'unzip -d .pup-zip/ fake-project.1.0.0.zip' ); + + $I->runShellCommand( "ls -a .pup-zip" ); + + $output = $I->grabShellOutput(); + + chdir( '.pup-zip' ); + + $I->runShellCommand( "ls -a node_modules" ); + + $output .= $I->grabShellOutput(); - $I->runShellCommand( "php {$this->pup} clean" ); - $this->reset_data_and_location(); + $this->assertMatchesStringSnapshot( $output ); } /** * @test */ - public function it_should_package_the_zip_and_include_files_in_distinclude_even_if_in_distignore_and_gitattributes( CliTester $I ) { - $this->reset_data_and_location(); + public function it_should_package_the_zip_and_include_files_in_distfiles_and_ignore_from_distignore( CliTester $I ) { $this->write_default_puprc(); chdir( $this->tests_root . '/_data/fake-project' ); - file_put_contents( '.distinclude', ".puprc\n" ); - file_put_contents( '.distignore', ".puprc\n" ); - file_put_contents( '.gitattributes', ".puprc export-ignore\n" ); + file_put_contents( '.distfiles', "/node_modules/a-script-i-need.js\nsrc/*\nbootstrap.php\nother-file.php\n" ); + file_put_contents( '.distignore', "other-file.php\n" ); $I->runShellCommand( "php {$this->pup} package 1.0.0" ); @@ -203,9 +185,39 @@ public function it_should_package_the_zip_and_include_files_in_distinclude_even_ $I->runShellCommand( "ls -a .pup-zip" ); $output = $I->grabShellOutput(); + + chdir( '.pup-zip' ); + + $I->runShellCommand( "ls -a src" ); + + $output .= $I->grabShellOutput(); + + $I->runShellCommand( "ls -a node_modules" ); + + $output .= $I->grabShellOutput(); + $this->assertMatchesStringSnapshot( $output ); + } + + /** + * @test + */ + public function it_should_package_the_zip_and_not_include_files_in_distinclude_even_if_in_distignore_and_gitattributes( CliTester $I ) { + $this->write_default_puprc(); + + chdir( $this->tests_root . '/_data/fake-project' ); + + file_put_contents( '.distinclude', ".puprc\n" ); + file_put_contents( '.distignore', ".puprc\nnode_modules/\n" ); + file_put_contents( '.gitattributes', ".puprc export-ignore\n" ); - $I->runShellCommand( "php {$this->pup} clean" ); - $this->reset_data_and_location(); + $I->runShellCommand( "php {$this->pup} package 1.0.0" ); + + system( 'unzip -d .pup-zip fake-project.1.0.0.zip' ); + + $I->runShellCommand( "ls -a .pup-zip/fake-project" ); + + $output = $I->grabShellOutput(); + $this->assertMatchesStringSnapshot( $output ); } } diff --git a/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_include_files_in_distfiles__0.snapshot.txt b/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_include_files_in_distfiles__0.snapshot.txt new file mode 100644 index 0000000..98bb2f3 --- /dev/null +++ b/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_include_files_in_distfiles__0.snapshot.txt @@ -0,0 +1,6 @@ +. +.. +fake-project +node_modules. +.. +a-script-i-need.js \ No newline at end of file diff --git a/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_include_files_in_distfiles_and_ignore_from_distignore__0.snapshot.txt b/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_include_files_in_distfiles_and_ignore_from_distignore__0.snapshot.txt new file mode 100644 index 0000000..c5b187e --- /dev/null +++ b/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_include_files_in_distfiles_and_ignore_from_distignore__0.snapshot.txt @@ -0,0 +1,11 @@ +. +.. +bootstrap.php +fake-project +node_modules +src. +.. +OtherFileWithBadVersion.php +Plugin.php. +.. +a-script-i-need.js \ No newline at end of file diff --git a/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_not_include_files_in_distinclude_even_if_in_distignore_and_gitattributes__0.snapshot.txt b/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_not_include_files_in_distinclude_even_if_in_distignore_and_gitattributes__0.snapshot.txt new file mode 100644 index 0000000..4d2073c --- /dev/null +++ b/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_not_include_files_in_distinclude_even_if_in_distignore_and_gitattributes__0.snapshot.txt @@ -0,0 +1,4 @@ +. +.. +bootstrap.php +src \ No newline at end of file From 2f0802bd2a3042ad554f77bc467615fc983c3f40 Mon Sep 17 00:00:00 2001 From: Fake Fake Date: Fri, 24 Jan 2025 19:28:46 +0200 Subject: [PATCH 12/20] Fixes after testing --- .gitignore | 1 + src/Filesystem/SyncFiles/SyncFiles.php | 11 +-------- tests/cli/Commands/PackageCest.php | 31 ++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 8ff71ca..760268e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .idea/ vendor/ *.phar +.vscode/ tests/_output tests/_support/_generated diff --git a/src/Filesystem/SyncFiles/SyncFiles.php b/src/Filesystem/SyncFiles/SyncFiles.php index 58fd37c..ff2e8d6 100644 --- a/src/Filesystem/SyncFiles/SyncFiles.php +++ b/src/Filesystem/SyncFiles/SyncFiles.php @@ -59,16 +59,7 @@ public static function getDistIgnore( string $root, array $paths = [] ): DistIgn $use_ignore_defaults = App::getConfig()->getZipUseDefaultIgnore(); $files = static::getSyncFiles( '.distignore' ); - $there_is_safelist = ! empty( - array_filter( - array_unique( - array_merge( - static::getSyncFiles( '.distfiles' ), - static::getSyncFiles( '.distinclude' ) - ) - ) - ) - ); + $there_is_safelist = file_exists( $root . '/.distfiles' ) || file_exists( $root . '/.distinclude' ); if ( ! $there_is_safelist && $use_ignore_defaults ) { $files[] = __PUP_DIR__ . '/.distignore-defaults'; diff --git a/tests/cli/Commands/PackageCest.php b/tests/cli/Commands/PackageCest.php index 1d18726..c32f069 100644 --- a/tests/cli/Commands/PackageCest.php +++ b/tests/cli/Commands/PackageCest.php @@ -199,6 +199,37 @@ public function it_should_package_the_zip_and_include_files_in_distfiles_and_ign $this->assertMatchesStringSnapshot( $output ); } + /** + * @test + */ + public function it_should_package_the_zip_and_use_default_distignore_when_no_safelist( CliTester $I ) { + $this->write_default_puprc(); + + chdir( $this->tests_root . '/_data/fake-project' ); + + file_put_contents( '.distignore', "other-file.php\n" ); + + $I->runShellCommand( "php {$this->pup} package 1.0.0" ); + + system( 'unzip -d .pup-zip/ fake-project.1.0.0.zip' ); + + $I->runShellCommand( "ls -a .pup-zip" ); + + $output = $I->grabShellOutput(); + + chdir( '.pup-zip' ); + + $I->runShellCommand( "ls -a src" ); + + $output .= $I->grabShellOutput(); + + $I->runShellCommand( "ls -a node_modules" ); + + $output .= $I->grabShellOutput(); + + $this->assertMatchesStringSnapshot( $output ); + } + /** * @test */ From 3fd34753452b361143d1492c8dce4e566e920e2a Mon Sep 17 00:00:00 2001 From: Fake Fake Date: Fri, 24 Jan 2025 19:30:26 +0200 Subject: [PATCH 13/20] Fix snapshots --- ...kage_the_zip_and_ignore_files_from_defaults__0.snapshot.txt | 2 -- ...the_zip_and_ignore_files_from_gitattributes__0.snapshot.txt | 3 --- .../ZipCest__it_should_zip_without_cloning__0.snapshot.txt | 3 ++- ...ithout_running_checks_when_checks_are_empty__0.snapshot.txt | 3 ++- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_ignore_files_from_defaults__0.snapshot.txt b/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_ignore_files_from_defaults__0.snapshot.txt index c235e9e..ace89d8 100644 --- a/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_ignore_files_from_defaults__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_ignore_files_from_defaults__0.snapshot.txt @@ -2,7 +2,5 @@ .. bootstrap.php fake-project -node_modules other-file.php -package.json src \ No newline at end of file diff --git a/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_ignore_files_from_gitattributes__0.snapshot.txt b/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_ignore_files_from_gitattributes__0.snapshot.txt index 9f42632..3f11399 100644 --- a/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_ignore_files_from_gitattributes__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_ignore_files_from_gitattributes__0.snapshot.txt @@ -1,8 +1,5 @@ . .. -.gitattributes fake-project -node_modules other-file.php -package.json src \ No newline at end of file diff --git a/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_without_cloning__0.snapshot.txt b/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_without_cloning__0.snapshot.txt index 96e746f..374e786 100644 --- a/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_without_cloning__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_without_cloning__0.snapshot.txt @@ -44,4 +44,5 @@ Cleaning up... -------------- ✓ Removing zip dir...Complete. -✓ Removing build dir...Complete. \ No newline at end of file +✓ Removing build dir...Complete. +✓ Removing .pup-distignore...Complete. \ No newline at end of file diff --git a/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_without_running_checks_when_checks_are_empty__0.snapshot.txt b/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_without_running_checks_when_checks_are_empty__0.snapshot.txt index d163559..646ba69 100644 --- a/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_without_running_checks_when_checks_are_empty__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/ZipCest__it_should_zip_without_running_checks_when_checks_are_empty__0.snapshot.txt @@ -31,4 +31,5 @@ Cleaning up... -------------- ✓ Removing zip dir...Complete. -✓ Removing build dir...Complete. \ No newline at end of file +✓ Removing build dir...Complete. +✓ Removing .pup-distignore...Complete. \ No newline at end of file From afb54ae10c4a021df9e985f6937391de5fb56aa7 Mon Sep 17 00:00:00 2001 From: Fake Fake Date: Fri, 24 Jan 2025 19:41:13 +0200 Subject: [PATCH 14/20] Fix bug with strpos --- src/Filesystem/SyncFiles/AbstractFile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Filesystem/SyncFiles/AbstractFile.php b/src/Filesystem/SyncFiles/AbstractFile.php index 5f618d3..04e1d14 100644 --- a/src/Filesystem/SyncFiles/AbstractFile.php +++ b/src/Filesystem/SyncFiles/AbstractFile.php @@ -94,7 +94,7 @@ public function writeContents( string $target_file ): string { foreach ( $this->getPaths() as $file ) { if ( ! file_exists( $this->getRoot() . $file ) ) { - if ( ! file_exists( $file ) || strpos( $file, __PUP_DIR__ ) === false ) { + if ( ! file_exists( $file ) || false !== strpos( $file, __PUP_DIR__ ) === false ) { $is_default = true; continue; } else { From df491ec3bbffe11b144c3cdc63d2224d243fd7b8 Mon Sep 17 00:00:00 2001 From: Fake Fake Date: Fri, 24 Jan 2025 20:02:04 +0200 Subject: [PATCH 15/20] finally resolve snapshot issues --- src/Filesystem/SyncFiles/AbstractFile.php | 25 ++++++++++++++++--- tests/cli/Commands/PackageCest.php | 4 --- ...dCest__it_should_run_build__0.snapshot.txt | 1 + ...nore_files_from_distignore__0.snapshot.txt | 3 --- ...stignore_and_gitattributes__0.snapshot.txt | 4 --- ...istignore_when_no_safelist__0.snapshot.txt | 8 ++++++ 6 files changed, 30 insertions(+), 15 deletions(-) create mode 100644 tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_use_default_distignore_when_no_safelist__0.snapshot.txt diff --git a/src/Filesystem/SyncFiles/AbstractFile.php b/src/Filesystem/SyncFiles/AbstractFile.php index 04e1d14..eec7c7a 100644 --- a/src/Filesystem/SyncFiles/AbstractFile.php +++ b/src/Filesystem/SyncFiles/AbstractFile.php @@ -5,6 +5,16 @@ use Symfony\Component\Finder\Glob; class AbstractFile { + /** + * An array of our default files. + * + * @var array + */ + protected const DEFAULTS = [ + '.distignore-defaults', + '.puprc-defaults' + ]; + /** * @var string */ @@ -94,12 +104,15 @@ public function writeContents( string $target_file ): string { foreach ( $this->getPaths() as $file ) { if ( ! file_exists( $this->getRoot() . $file ) ) { - if ( ! file_exists( $file ) || false !== strpos( $file, __PUP_DIR__ ) === false ) { - $is_default = true; + if ( ! file_exists( $file ) ) { continue; - } else { - $path = $file; } + + if ( $this->is_default( $file ) ) { + $is_default = true; + } + + $path = $file; } else { $path = $this->getRoot() . $file; } @@ -146,6 +159,10 @@ public function writeContents( string $target_file ): string { return (string) file_get_contents( $this->getRoot() . $target_file ); } + public function is_default( string $file ): bool { + return in_array( $file, array_map( fn( $default_file ) => __PUP_DIR__ . '/' . $default_file, static::DEFAULTS ), true ); + } + /** * Writes the file. * diff --git a/tests/cli/Commands/PackageCest.php b/tests/cli/Commands/PackageCest.php index c32f069..cf123e1 100644 --- a/tests/cli/Commands/PackageCest.php +++ b/tests/cli/Commands/PackageCest.php @@ -223,10 +223,6 @@ public function it_should_package_the_zip_and_use_default_distignore_when_no_saf $output .= $I->grabShellOutput(); - $I->runShellCommand( "ls -a node_modules" ); - - $output .= $I->grabShellOutput(); - $this->assertMatchesStringSnapshot( $output ); } diff --git a/tests/cli/Commands/__snapshots__/BuildCest__it_should_run_build__0.snapshot.txt b/tests/cli/Commands/__snapshots__/BuildCest__it_should_run_build__0.snapshot.txt index cfc0167..7a6e94d 100644 --- a/tests/cli/Commands/__snapshots__/BuildCest__it_should_run_build__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/BuildCest__it_should_run_build__0.snapshot.txt @@ -5,6 +5,7 @@ Running build steps... . .. +.pup-zip .puprc bootstrap.php node_modules diff --git a/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_ignore_files_from_distignore__0.snapshot.txt b/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_ignore_files_from_distignore__0.snapshot.txt index 21adcb2..3f11399 100644 --- a/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_ignore_files_from_distignore__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_ignore_files_from_distignore__0.snapshot.txt @@ -1,8 +1,5 @@ . .. -.distignore fake-project -node_modules other-file.php -package.json src \ No newline at end of file diff --git a/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_ignore_files_from_distignore_and_gitattributes__0.snapshot.txt b/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_ignore_files_from_distignore_and_gitattributes__0.snapshot.txt index 5f5f62b..7fa1da4 100644 --- a/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_ignore_files_from_distignore_and_gitattributes__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_ignore_files_from_distignore_and_gitattributes__0.snapshot.txt @@ -1,8 +1,4 @@ . .. -.distignore -.gitattributes fake-project -node_modules -package.json src \ No newline at end of file diff --git a/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_use_default_distignore_when_no_safelist__0.snapshot.txt b/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_use_default_distignore_when_no_safelist__0.snapshot.txt new file mode 100644 index 0000000..c56a6de --- /dev/null +++ b/tests/cli/Commands/__snapshots__/PackageCest__it_should_package_the_zip_and_use_default_distignore_when_no_safelist__0.snapshot.txt @@ -0,0 +1,8 @@ +. +.. +bootstrap.php +fake-project +src. +.. +OtherFileWithBadVersion.php +Plugin.php \ No newline at end of file From b60e529f4282db8edda0592c74a1f6582cbda430 Mon Sep 17 00:00:00 2001 From: Fake Fake Date: Fri, 24 Jan 2025 20:12:51 +0200 Subject: [PATCH 16/20] try to manually fix some snapshots --- ...hould_run_fail_tbd_check_when_tbds_exist__0.snapshot.txt | 6 +++--- ...arguments_and_options_to_workflow_script__0.snapshot.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/cli/Commands/Checks/__snapshots__/TbdCest__it_should_run_fail_tbd_check_when_tbds_exist__0.snapshot.txt b/tests/cli/Commands/Checks/__snapshots__/TbdCest__it_should_run_fail_tbd_check_when_tbds_exist__0.snapshot.txt index 6dfa347..695f409 100644 --- a/tests/cli/Commands/Checks/__snapshots__/TbdCest__it_should_run_fail_tbd_check_when_tbds_exist__0.snapshot.txt +++ b/tests/cli/Commands/Checks/__snapshots__/TbdCest__it_should_run_fail_tbd_check_when_tbds_exist__0.snapshot.txt @@ -2,9 +2,6 @@ Checking for TBDs... -------------------- -./src/Plugin.php -9: * @since TBD - ./src/Thing/AnotherFile.php 5: _deprecated_file( __FILE__, 'TBD' ); 9: * @since TBD @@ -14,5 +11,8 @@ Checking for TBDs... 28: * @deprecated TBD 32: _deprecated_function( __METHOD__, 'TBD' ); +./src/Plugin.php +9: * @since TBD + TBDs have been found! \ No newline at end of file diff --git a/tests/cli/Commands/__snapshots__/WorkflowCest__it_should_pass_additional_arguments_and_options_to_workflow_script__0.snapshot.txt b/tests/cli/Commands/__snapshots__/WorkflowCest__it_should_pass_additional_arguments_and_options_to_workflow_script__0.snapshot.txt index 3d3741a..a244ac5 100644 --- a/tests/cli/Commands/__snapshots__/WorkflowCest__it_should_pass_additional_arguments_and_options_to_workflow_script__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/WorkflowCest__it_should_pass_additional_arguments_and_options_to_workflow_script__0.snapshot.txt @@ -1,7 +1,7 @@ Running test-workflow workflow steps... > {PUP_ROOT}/pup/tests/_data/test-workflow-script.sh 'arg1' 'arg2' '--option-one=one' '--option-two=two' ------------------------------------------------------------------------------------------------------------------------------- ++------------------------------------------------------------------------------------------------------------------- Argument: arg1 Argument: arg2 From a476baec074d3d9a2f2de90479323c0c6756c4c5 Mon Sep 17 00:00:00 2001 From: Fake Fake Date: Fri, 24 Jan 2025 20:14:12 +0200 Subject: [PATCH 17/20] fix a snpashot manually --- ...nal_arguments_and_options_to_workflow_script__0.snapshot.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cli/Commands/__snapshots__/WorkflowCest__it_should_pass_additional_arguments_and_options_to_workflow_script__0.snapshot.txt b/tests/cli/Commands/__snapshots__/WorkflowCest__it_should_pass_additional_arguments_and_options_to_workflow_script__0.snapshot.txt index a244ac5..02b0b3a 100644 --- a/tests/cli/Commands/__snapshots__/WorkflowCest__it_should_pass_additional_arguments_and_options_to_workflow_script__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/WorkflowCest__it_should_pass_additional_arguments_and_options_to_workflow_script__0.snapshot.txt @@ -1,7 +1,7 @@ Running test-workflow workflow steps... > {PUP_ROOT}/pup/tests/_data/test-workflow-script.sh 'arg1' 'arg2' '--option-one=one' '--option-two=two' -+------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------------------------------------------- Argument: arg1 Argument: arg2 From aaaefb982a06299915e898892461d9a97fe1c1b2 Mon Sep 17 00:00:00 2001 From: Fake Fake Date: Fri, 24 Jan 2025 20:15:49 +0200 Subject: [PATCH 18/20] fixed snapshot from local --- .../__snapshots__/BuildCest__it_should_run_build__0.snapshot.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/cli/Commands/__snapshots__/BuildCest__it_should_run_build__0.snapshot.txt b/tests/cli/Commands/__snapshots__/BuildCest__it_should_run_build__0.snapshot.txt index 7a6e94d..cfc0167 100644 --- a/tests/cli/Commands/__snapshots__/BuildCest__it_should_run_build__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/BuildCest__it_should_run_build__0.snapshot.txt @@ -5,7 +5,6 @@ Running build steps... . .. -.pup-zip .puprc bootstrap.php node_modules From c49d936517005305a21c662f3048388514515f14 Mon Sep 17 00:00:00 2001 From: Fake Fake Date: Fri, 24 Jan 2025 20:18:26 +0200 Subject: [PATCH 19/20] manually try for fixing test --- ..._when_tbds_exist_and_fail_method_is_warn__0.snapshot.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/cli/Commands/__snapshots__/CheckCest__it_should_ignore_fail_tbd_check_when_tbds_exist_and_fail_method_is_warn__0.snapshot.txt b/tests/cli/Commands/__snapshots__/CheckCest__it_should_ignore_fail_tbd_check_when_tbds_exist_and_fail_method_is_warn__0.snapshot.txt index dadc3c9..7b3dd52 100644 --- a/tests/cli/Commands/__snapshots__/CheckCest__it_should_ignore_fail_tbd_check_when_tbds_exist_and_fail_method_is_warn__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/CheckCest__it_should_ignore_fail_tbd_check_when_tbds_exist_and_fail_method_is_warn__0.snapshot.txt @@ -2,9 +2,6 @@ [tbd] Checking for TBDs... [tbd] -------------------- -[tbd] ./src/Plugin.php -[tbd] 9: * @since TBD -[tbd] [tbd] ./src/Thing/AnotherFile.php [tbd] 5: _deprecated_file( __FILE__, 'TBD' ); [tbd] 9: * @since TBD @@ -13,6 +10,9 @@ [tbd] 19: * @version tbd [tbd] 28: * @deprecated TBD [tbd] 32: _deprecated_function( __METHOD__, 'TBD' ); +[tbd] ./src/Plugin.php +[tbd] 9: * @since TBD +[tbd] [tbd] [tbd] [tbd] TBDs have been found! From 3e884b7310b422c5903f1c77e4ac2d9e5f690ad4 Mon Sep 17 00:00:00 2001 From: Fake Fake Date: Fri, 24 Jan 2025 20:19:55 +0200 Subject: [PATCH 20/20] manually fixing snapshots --- ...heck_when_tbds_exist_and_fail_method_is_warn__0.snapshot.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cli/Commands/__snapshots__/CheckCest__it_should_ignore_fail_tbd_check_when_tbds_exist_and_fail_method_is_warn__0.snapshot.txt b/tests/cli/Commands/__snapshots__/CheckCest__it_should_ignore_fail_tbd_check_when_tbds_exist_and_fail_method_is_warn__0.snapshot.txt index 7b3dd52..82f81a6 100644 --- a/tests/cli/Commands/__snapshots__/CheckCest__it_should_ignore_fail_tbd_check_when_tbds_exist_and_fail_method_is_warn__0.snapshot.txt +++ b/tests/cli/Commands/__snapshots__/CheckCest__it_should_ignore_fail_tbd_check_when_tbds_exist_and_fail_method_is_warn__0.snapshot.txt @@ -10,11 +10,11 @@ [tbd] 19: * @version tbd [tbd] 28: * @deprecated TBD [tbd] 32: _deprecated_function( __METHOD__, 'TBD' ); +[tbd] [tbd] ./src/Plugin.php [tbd] 9: * @since TBD [tbd] [tbd] -[tbd] [tbd] TBDs have been found! [version-conflict] Checking for version conflicts...