Skip to content

Commit c083fa5

Browse files
authored
fix: Parent connection classes namespaces updated. (#696)
1 parent e2a72bf commit c083fa5

File tree

8 files changed

+67
-40
lines changed

8 files changed

+67
-40
lines changed

bin/_lib.sh

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,13 @@ install_wordpress() {
2222
# Install Wordpress + integrated plugins for testing/development.
2323
composer install
2424
composer require --dev -W \
25-
composer/installers \
26-
johnpbloch/wordpress:~${WP_VERSION} \
25+
johnpbloch/wordpress:* \
2726
wp-graphql/wp-graphql-jwt-authentication \
2827
wpackagist-plugin/woocommerce \
2928
wpackagist-plugin/woocommerce-gateway-stripe \
30-
wpackagist-plugin/wp-graphql \
29+
wpackagist-plugin/wp-graphql:* \
3130
wpackagist-theme/twentytwentyone \
32-
wp-cli/wp-cli-bundle:*
31+
wp-cli/wp-cli-bundle
3332
}
3433

3534
remove_wordpress() {
@@ -52,7 +51,7 @@ remove_wordpress() {
5251
install_local_test_library() {
5352
# Install testing library dependencies.
5453
composer install
55-
composer require --dev --with-all-dependencies \
54+
composer require --dev \
5655
lucatume/wp-browser \
5756
codeception/module-asserts:^1.0 \
5857
codeception/module-rest:^2.0 \
@@ -62,6 +61,23 @@ install_local_test_library() {
6261

6362
}
6463

64+
remove_local_composer_instance() {
65+
if [ -f $PROJECT_ROOT_DIR/vendor/bin/composer ]; then
66+
rm -f $PROJECT_ROOT_DIR/vendor/bin/composer
67+
else
68+
echo "No local composer instance found."
69+
fi
70+
}
71+
72+
remove_project_symlink() {
73+
if [ -f $WP_CORE_DIR/wp-content/plugins/wp-graphql-woocommerce ]; then
74+
rm -rf $WP_CORE_DIR/wp-content/plugins/wp-graphql-woocommerce
75+
echo "Plugin symlink removed."
76+
else
77+
echo "Symlink no found."
78+
fi
79+
}
80+
6581
remove_local_test_library() {
6682
# Remove testing library dependencies.
6783
composer remove --dev wp-graphql/wp-graphql-testcase \
@@ -72,6 +88,20 @@ remove_local_test_library() {
7288
stripe/stripe-php
7389
}
7490

91+
cleanup_local_files() {
92+
if [ -n "$(ls -A $WP_CORE_DIR)" ]; then
93+
echo "Removing final test files..."
94+
rm -rf $WP_CORE_DIR/*
95+
echo "Files removed!!"
96+
else
97+
echo "No files to remove!"
98+
fi
99+
100+
echo "Rebuilding lock file..."
101+
rm -rf $PROJECT_ROOT_DIR/vendor $PROJECT_ROOT_DIR/composer.lock
102+
composer install --no-dev
103+
}
104+
75105
install_db() {
76106
if [ ${SKIP_DB_CREATE} = "true" ]; then
77107
echo "Skipping database creation..."

bin/remove-wordpress.local.sh renamed to bin/cleanup.local.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,23 @@ BASEDIR=$(dirname "$0");
1515
source ${BASEDIR}/_env.sh
1616
source ${BASEDIR}/_lib.sh
1717

18+
# Remove any local Composer instances that could
19+
# potentially get in the way of any file removals.
20+
remove_local_composer_instance
21+
22+
# Uninstall WordPress from project and Composer.
1823
remove_wordpress
1924

20-
composer install --no-dev
25+
# Delete symlink to
26+
remove_project_symlink
2127

2228
# Remove "extra" config.
2329
composer config --unset extra.wordpress-install-dir
2430
composer config --unset extra.installer-paths
31+
32+
# Remove testing dependencies from Composer.
33+
remove_local_test_library
34+
35+
# Delete any missed files in the removal of the local installation.
36+
# And rebuild composer.lock
37+
cleanup_local_files

bin/remove-testing-library.local.sh

Lines changed: 0 additions & 19 deletions
This file was deleted.

composer.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,7 @@
5555
},
5656
"scripts": {
5757
"installTestEnv": "bash bin/install-test-env.local.sh",
58-
"runPreCommitCleanup": [
59-
"bash bin/remove-wordpress.local.sh",
60-
"bash bin/remove-testing-library.local.sh"
61-
],
58+
"runPreCommitCleanup": "bash bin/cleanup.local.sh",
6259
"runWPUnitTest": "vendor/bin/codecept run wpunit",
6360
"dBuild": "env $(sed -e '/^#/d' .env.testing) docker-compose build",
6461
"dRunApp": "env $(sed -e '/^#/d' .env.testing) docker-compose up testable_app app_db mailhog",

composer.lock

Lines changed: 13 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

includes/connection/class-comments.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@
1212

1313
use GraphQL\Type\Definition\ResolveInfo;
1414
use WPGraphQL\AppContext;
15+
use WPGraphQL\Type\Connection\Comments as Comments_Core;
1516

1617
/**
1718
* Class - Comments
1819
*/
19-
class Comments extends \WPGraphQL\Connection\Comments {
20+
class Comments extends Comments_Core {
2021

2122
/**
2223
* Registers connection.

includes/connection/class-posts.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
use GraphQL\Type\Definition\ResolveInfo;
1313
use WPGraphQL\AppContext;
14-
use WPGraphQL\Connection\PostObjects;
14+
use WPGraphQL\Type\Connection\PostObjects;
1515
use WPGraphQL\Data\Connection\PostObjectConnectionResolver;
1616

1717
/**

includes/connection/class-wc-terms.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use GraphQL\Type\Definition\ResolveInfo;
1414
use GraphQL\Error\UserError;
1515
use WPGraphQL\AppContext;
16-
use WPGraphQL\Connection\TermObjects;
16+
use WPGraphQL\Type\Connection\TermObjects;
1717
use WPGraphQL\Data\DataSource;
1818
use WPGraphQL\Data\Connection\TermObjectConnectionResolver;
1919
use WPGraphQL;

0 commit comments

Comments
 (0)