Skip to content

Commit 2543f33

Browse files
authored
fix: Bug in Session_Transaction_Manager::pop_transaction_id() fixed (#852)
* fix: bug in Session_Transaction_Manager::pop_transaction_id fixed * chore: Linter and PHPStan compliance met * devops: tests updated * devops: WPBrowser upgraded to v4.x.x * devops: Some unit testing configurations updated * devops: WPBrowser updated and tests passing * chore: PHPStan and linter compliance met * devops: WP_CORE_DIR fixed * devops: More docker config changes * devops: CartMutationsTest updated * devops: CI env vars fixed * devops: More CI fixes * devops: More CI fixes * devops: More CI fixes * devop: Docker env removed * devops: Codeception configs updated * devops: configurations tweaked heavily
1 parent f686e74 commit 2543f33

26 files changed

+610
-403
lines changed

Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ ENV PATH "$PATH:~/.composer/vendor/bin"
3838
# Install wp-browser globally
3939
RUN composer global require --optimize-autoloader \
4040
wp-cli/wp-cli-bundle:* \
41-
lucatume/wp-browser:3.2.3 \
41+
"lucatume/wp-browser:>3.1 <3.5" \
4242
phpunit/phpunit:^9.6 \
4343
codeception/module-asserts:* \
4444
codeception/module-cli:* \
@@ -48,10 +48,11 @@ RUN composer global require --optimize-autoloader \
4848
codeception/module-rest:* \
4949
codeception/module-webdriver:* \
5050
codeception/util-universalframework:* \
51+
guzzlehttp/guzzle \
5152
league/factory-muffin \
5253
league/factory-muffin-faker \
5354
stripe/stripe-php \
54-
wp-graphql/wp-graphql-testcase
55+
wp-graphql/wp-graphql-testcase:^3.2
5556

5657
# Remove exec statement from base entrypoint script.
5758
RUN sed -i '$d' /usr/local/bin/docker-entrypoint.sh
@@ -74,8 +75,8 @@ ENV PROJECT_DIR="${PLUGINS_DIR}/wp-graphql-woocommerce"
7475
RUN echo 'ServerName localhost' >> /etc/apache2/apache2.conf
7576
RUN a2enmod rewrite
7677

77-
7878
WORKDIR /var/www/html
79+
7980
# Set codecept wrapper
8081
COPY bin/codecept /usr/local/bin/codecept
8182
RUN chmod 755 /usr/local/bin/codecept

SECURITY.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Security Policy
22

33
## Supported Versions
4+
45
Current only the most stable release has security update support.
5-
Meaning security patches are always patched the latest stable release.
6+
Meaning security patches are always patched the latest stable release.
67

78
## Reporting a Vulnerability
8-
Do not report potential security vulnerabilities here. Email them privately to our security team at [email protected]
9+
10+
Do not report potential security vulnerabilities here. Report your finding using the contact form found [here](https://woographql.com/support#contact) or email them privately to our security team at <[email protected]>

bin/_lib.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,13 @@ install_local_test_library() {
6565
# Install testing library dependencies.
6666
composer install
6767
composer require --dev -W \
68-
lucatume/wp-browser:3.2.3 \
68+
"lucatume/wp-browser:>3.1 <3.5" \
6969
phpunit/phpunit:^9.6 \
7070
codeception/lib-asserts:* \
7171
codeception/module-asserts:* \
7272
codeception/module-rest:* \
7373
codeception/util-universalframework:* \
74-
wp-graphql/wp-graphql-testcase \
74+
wp-graphql/wp-graphql-testcase:^3.2 \
7575
stripe/stripe-php \
7676
fakerphp/faker
7777

bin/entrypoint.sh

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,30 @@ if [ "$USING_XDEBUG" == "1" ]; then
66
fi
77

88
# Run WordPress docker entrypoint.
9+
# shellcheck disable=SC1091
910
. docker-entrypoint.sh 'apache2'
1011

1112
set +u
1213

1314
# Ensure mysql is loaded
14-
wait-for-it -s -t 300 ${DB_HOST}:${DB_PORT} -- echo "Application database is operationally..."
15+
wait-for-it -s -t 300 "${DB_HOST}:${DB_PORT}" -- echo "Application database is operationally..."
1516

1617
# Setup tester scripts.
17-
if [ ! -f $WP_ROOT_FOLDER/setup-database.sh ]; then
18-
ln -s $PROJECT_DIR/bin/setup-database.sh $WP_ROOT_FOLDER/setup-database.sh
19-
chmod +x $WP_ROOT_FOLDER/setup-database.sh
18+
if [ ! -f "$WP_ROOT_FOLDER/setup-database.sh" ]; then
19+
ln -s "$PROJECT_DIR/bin/setup-database.sh" "$WP_ROOT_FOLDER/setup-database.sh"
20+
chmod +x "$WP_ROOT_FOLDER/setup-database.sh"
2021
fi
2122

2223
# Update our domain to just be the docker container's IP address
2324
export WORDPRESS_DOMAIN=${WORDPRESS_DOMAIN-$( hostname -i )}
2425
export WORDPRESS_URL="http://$WORDPRESS_DOMAIN"
25-
if [ -f $PROJECT_DIR/.env.docker ]; then
26-
rm $PROJECT_DIR/.env.docker
27-
fi
28-
echo "WORDPRESS_DOMAIN=$WORDPRESS_DOMAIN" >> $PROJECT_DIR/.env.docker
29-
echo "WORDPRESS_URL=$WORDPRESS_URL" >> $PROJECT_DIR/.env.docker
26+
echo "WORDPRESS_DOMAIN=$WORDPRESS_DOMAIN" > "$PROJECT_DIR/.env.docker"
27+
echo "WORDPRESS_URL=$WORDPRESS_URL" >> "$PROJECT_DIR/.env.docker"
3028

3129
# Config WordPress
3230
if [ -f "${WP_ROOT_FOLDER}/wp-config.php" ]; then
3331
echo "Deleting old wp-config.php"
34-
rm ${WP_ROOT_FOLDER}/wp-config.php
32+
rm -f "${WP_ROOT_FOLDER}/wp-config.php"
3533
fi
3634

3735
echo "Creating wp-config.php..."
@@ -83,31 +81,28 @@ if wp config has GRAPHQL_DEBUG --allow-root; then
8381
wp config delete GRAPHQL_DEBUG --allow-root
8482
fi
8583
if [[ -n "$GRAPHQL_DEBUG" ]]; then
86-
wp config set GRAPHQL_DEBUG $GRAPHQL_DEBUG --allow-root
84+
wp config set GRAPHQL_DEBUG "$GRAPHQL_DEBUG" --allow-root
8785
fi
8886

8987
if [[ -n "$IMPORT_WC_PRODUCTS" ]]; then
9088
echo "Installing & Activating WordPress Importer..."
9189
wp plugin install wordpress-importer --activate --allow-root
9290
echo "Importing store products..."
9391
wp import \
94-
${PLUGINS_DIR}/woocommerce/sample-data/sample_products.xml \
92+
"${PLUGINS_DIR}/woocommerce/sample-data/sample_products.xml" \
9593
--authors=skip --allow-root
9694
fi
9795

9896
echo "Setting pretty permalinks..."
9997
wp rewrite structure '/%year%/%monthnum%/%postname%/' --allow-root
10098

10199
echo "Prepare for app database dump..."
102-
if [ ! -d "${PROJECT_DIR}/local/db" ]; then
103-
mkdir ${PROJECT_DIR}/local/db
104-
fi
105-
if [ -f "${PROJECT_DIR}/local/db/app_db.sql" ]; then
106-
rm ${PROJECT_DIR}/local/db/app_db.sql
100+
if [ -f "${PROJECT_DIR}/tests/_data/app_db.sql" ]; then
101+
rm -f "${PROJECT_DIR}/tests/_data/app_db.sql"
107102
fi
108103

109104
echo "Dumping app database..."
110-
wp db export "${PROJECT_DIR}/local/db/app_db.sql" \
105+
wp db export "${PROJECT_DIR}/tests/_data/app_db.sql" \
111106
--dbuser="root" \
112107
--dbpass="${ROOT_PASSWORD}" \
113108
--skip-plugins \

codeception.dist.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ paths:
66
envs: tests/_envs
77
params:
88
- env
9-
- .env
109
- .env.docker
1110
actor_suffix: Tester
1211
settings:
@@ -35,12 +34,15 @@ extensions:
3534
- Codeception\Command\GenerateWPXMLRPC
3635
modules:
3736
config:
37+
\Tests\WPGraphQL\Codeception\Module\WPGraphQL:
38+
endpoint: '%WORDPRESS_URL%/graphql'
3839
WPDb:
3940
dsn: 'mysql:host=%DB_HOST%;dbname=%DB_NAME%'
4041
user: '%DB_USER%'
4142
password: '%DB_PASSWORD%'
43+
populator: 'mysql -u $user -p$password -h $host $dbname < $dump'
4244
dump: 'local/db/app_db.sql'
43-
populate: false
45+
populate: true
4446
cleanup: false
4547
waitlock: 10
4648
url: '%WORDPRESS_URL%'
@@ -64,10 +66,7 @@ modules:
6466
uploads: '/wp-content/uploads'
6567
WPLoader:
6668
wpRootFolder: '%WP_CORE_DIR%'
67-
dbName: '%DB_NAME%'
68-
dbHost: '%DB_HOST%'
69-
dbUser: '%DB_USER%'
70-
dbPassword: '%DB_PASSWORD%'
69+
dbUrl: 'mysql://%DB_USER%:%DB_PASSWORD%@%DB_HOST%:%DB_PORT%/%DB_NAME%'
7170
tablePrefix: '%WP_TABLE_PREFIX%'
7271
domain: '%WORDPRESS_DOMAIN%'
7372
adminEmail: '%ADMIN_EMAIL%'
@@ -85,3 +84,5 @@ modules:
8584
- wp-graphql-jwt-authentication/wp-graphql-jwt-authentication.php
8685
- wp-graphql-woocommerce/wp-graphql-woocommerce.php
8786
configFile: 'tests/_data/config.php'
87+
88+

0 commit comments

Comments
 (0)