Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions .env.testing
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@ MUPLUGINS_DIR=
THEMES_DIR=

# WordPress database configurations
DB_NAME=wordpress
DB_HOST=app_db
DB_PORT=3306
DB_USER=wordpress
DB_PASSWORD=password
ROOT_PASSWORD=password
WP_TABLE_PREFIX=wp_
SKIP_DB_CREATE=true
SKIP_WP_SETUP=true
DB_NAME=wordpress_test
DB_USER=root
DB_PASSWORD=
DB_HOST=127.0.0.1
DB_PORT=3308
DB_PREFIX=wp_


# Extra environmental variables/constants.
GRAPHQL_JWT_AUTH_SECRET_KEY=testingtesting123
Expand Down
12 changes: 6 additions & 6 deletions access-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ function str_ends_with( $haystack, $needle ) {
* @return array
*/
function wc_graphql_map_tax_statements( $raw_taxes ) {
$taxes = [];
$taxes = array();
foreach ( $raw_taxes as $field => $values ) {
foreach ( $values as $id => $amount ) {
if ( empty( $taxes[ $id ] ) ) {
$taxes[ $id ] = [];
$taxes[ $id ] = array();
}
$taxes[ $id ]['ID'] = $id;
$taxes[ $id ][ $field ] = $amount;
Expand All @@ -73,7 +73,7 @@ function wc_graphql_map_tax_statements( $raw_taxes ) {
* @return array
*/
function wc_graphql_get_order_statuses() {
$order_statuses = [];
$order_statuses = array();
foreach ( array_keys( wc_get_order_statuses() ) as $status ) {
$order_statuses[] = str_replace( 'wc-', '', $status );
}
Expand Down Expand Up @@ -103,19 +103,19 @@ function wc_graphql_get_order_statuses() {
* }
* @return string
*/
function wc_graphql_price( $price, $args = [] ) {
function wc_graphql_price( $price, $args = array() ) {
$price = floatval( $price );
$args = apply_filters(
'wc_price_args', // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
wp_parse_args(
$args,
[
array(
'currency' => '',
'decimal_separator' => wc_get_price_decimal_separator(),
'thousand_separator' => wc_get_price_thousand_separator(),
'decimals' => wc_get_price_decimals(),
'price_format' => get_woocommerce_price_format(),
]
)
)
);

Expand Down
4 changes: 2 additions & 2 deletions codeception.dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ paths:
support: tests/_support
envs: tests/_envs
params:
- env
- .env.docker
- .env
# - .env.docker
actor_suffix: Tester
settings:
colors: true
Expand Down
27 changes: 20 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,23 @@
"axepress/wp-graphql-cs": "^2.0.0-beta",
"axepress/wp-graphql-stubs": "^1.27.1",
"brainmaestro/composer-git-hooks": "^2.8.5",
"codeception/codeception": "*",
"codeception/module-asserts": "*",
"codeception/module-phpbrowser": "*",
"codeception/module-rest": "*",
"lucatume/wp-browser": "*",
"php-stubs/woocommerce-stubs": "9.1.0",
"phpcsstandards/phpcsutils": "^1.0",
"phpstan/extension-installer": "^1.3",
"phpstan/phpdoc-parser": "^1.22.0",
"phpstan/phpstan": "^1.10",
"szepeviktor/phpstan-wordpress": "^1.3"
"squizlabs/php_codesniffer": "^3.7",
"szepeviktor/phpstan-wordpress": "^1.3",
"wp-coding-standards/wpcs": "^3.1",
"phpunit/phpunit": "^9.6 || ^10.0 || ^11.0",
"dealerdirect/phpcodesniffer-composer-installer": "^1.0",
"phpcompatibility/phpcompatibility-wp": "^2.1",
"sirbrillig/phpcs-variable-analysis": "^2.11"
},
"config": {
"optimize-autoloader": true,
Expand Down Expand Up @@ -73,8 +85,8 @@
],
"dRunTestStandalone": "env $(sed -e '/^#/d' .env.testing) docker compose run --rm run_tests",
"dDestroy": "docker compose down -v",
"lint": "vendor/bin/phpcs -vp .",
"fix": "vendor/bin/phpcbf -vp .",
"lint": "phpcs -p --standard=WordPress --extensions=php .",
"lint:fix": "phpcbf -p --standard=WordPress --extensions=php .",
"stan": "phpstan analyze --ansi --memory-limit=1G",
"strauss": [
"test -f ./bin/strauss.phar || curl -o bin/strauss.phar -L -C - https://github.com/BrianHenryIE/strauss/releases/download/0.14.0/strauss.phar",
Expand All @@ -92,7 +104,8 @@
"post-update-cmd": [
"@strauss",
"[ $COMPOSER_DEV_MODE -eq 0 ] || composer cghooks update"
]
],
"test": "phpunit"
},
"support": {
"issues": "https://github.com/wp-graphql/wp-graphql-woocommerce/issues",
Expand Down Expand Up @@ -121,14 +134,14 @@
]
},
"extra": {
"strauss" : {
"strauss": {
"target_directory": "vendor-prefixed",
"namespace_prefix": "WPGraphQL\\WooCommerce\\Vendor\\",
"classmap_prefix": "WP_GraphQL_WooCommerce_Vendor",
"constant_prefix": "WPGRAPHQL_WOOCOMMERCE_VENDOR",
"delete_vendor_files": true,
"include_modified_date": false,
"packages" : [
"packages": [
"firebase/php-jwt"
],
"exclude_from_prefix": {
Expand All @@ -144,4 +157,4 @@
]
}
}
}
}
Loading