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

feat: QL Events settings tab added and schema organized #55

Merged
merged 41 commits into from
May 26, 2023
Merged
Show file tree
Hide file tree
Changes from 39 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
228a9f2
feat: QL Events settings tab added and schema organized
kidunot89 Apr 24, 2023
65498ca
chore: WPCS compliance met
kidunot89 Apr 25, 2023
5611853
fix: ci script updated.
kidunot89 Apr 25, 2023
7ee0178
fix: ci script updated.
kidunot89 Apr 25, 2023
4a8b475
fix: ci script updated.
kidunot89 Apr 25, 2023
d4a23c0
fix: ci script updated.
kidunot89 Apr 25, 2023
b377143
fix: ci script updated.
kidunot89 Apr 25, 2023
1808385
fix: ci script updated.
kidunot89 Apr 25, 2023
39b1f4a
fix: ci script updated.
kidunot89 Apr 25, 2023
bdb1580
fix: ci script updated.
kidunot89 Apr 25, 2023
fedf82a
refactor: registerAttendee output field resolver refactored.
kidunot89 Apr 25, 2023
d516528
fix: Ticket fields patched and tested.
kidunot89 Apr 25, 2023
247f974
chore: WPCS compliance met
kidunot89 Apr 25, 2023
58f148d
fix: Introspection regression fixed.
kidunot89 Apr 27, 2023
f013383
chore: WPCS compliance met
kidunot89 Apr 27, 2023
ee3d690
chore: WPCS compliance met
kidunot89 Apr 27, 2023
7bd8ca4
devops: Custom Table support added to tests
kidunot89 May 25, 2023
db5c452
devops: ci alt script updated.
kidunot89 May 25, 2023
d0f4ac4
devops: ci alt script updated.
kidunot89 May 25, 2023
2d6702d
devops: ci alt script updated.
kidunot89 May 25, 2023
24e4d65
devops: ci alt script updated.
kidunot89 May 25, 2023
bc77c54
devops: ci alt script updated.
kidunot89 May 25, 2023
ac14231
devops: ci alt script updated.
kidunot89 May 25, 2023
fbc60ca
devops: ci alt script updated.
kidunot89 May 25, 2023
f056e51
chore: composer.json cleaned
kidunot89 May 25, 2023
76049a8
devops: composer.json updated.
kidunot89 May 25, 2023
d9dd7ed
devops: composer.json updated.
kidunot89 May 25, 2023
6b11396
devops: WP + PHP version can now be passed to docker-compose
kidunot89 May 25, 2023
9d89908
devops: More changes to docker configurations
kidunot89 May 25, 2023
dc16ba9
devops: XDEBUG Version set in ci script.
kidunot89 May 25, 2023
a875d15
devops: XDEBUG Version set in ci script.
kidunot89 May 25, 2023
59ccf6c
devops: XDEBUG version finally fixed.
kidunot89 May 25, 2023
3c30666
refactor: QL_Events::is_test_mode_active() function implemented
kidunot89 May 25, 2023
9c014bb
devops: xdebug enabled in dockerfile.
kidunot89 May 25, 2023
5ccba40
devops: xdebug enabled in dockerfile.
kidunot89 May 25, 2023
65fd12c
devops: xdebug enabled in dockerfile.
kidunot89 May 25, 2023
1beaf7d
devops: Syntax error fixed in Dockerfile
kidunot89 May 25, 2023
765faff
devops: Syntax error fixed in Dockerfile
kidunot89 May 25, 2023
f94f78d
chore: Linter compliance met.
kidunot89 May 25, 2023
a1c6c51
Update includes/types/object/class-wooattendee-type.php
kidunot89 May 26, 2023
ecbac4d
chore: Linter compliance met.
kidunot89 May 26, 2023
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
2 changes: 1 addition & 1 deletion .env.testing
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ WP_TEST_DB_PORT=3306
WP_TEST_DB_USER=wordpress
WP_TEST_DB_PASSWORD=password
ROOT_PASSWORD=password
WP_TABLE_PREFIX=wp_
WP_TABLE_PREFIX=test_
SKIP_DB_CREATE=true
SKIP_WP_SETUP=true

Expand Down
2 changes: 1 addition & 1 deletion .env.testing.tric
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ WP_DB_PORT=3306

# The databse is served from the Docker `db` container.
# See `dev/docker/ci-compose.yml` for more information.
WP_TABLE_PREFIX=wp_
WP_TABLE_PREFIX=test_
WP_DB_HOST=db
WP_DB_NAME=test
WP_DB_USER=root
Expand Down
22 changes: 14 additions & 8 deletions .github/workflows/tests-php-alt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,25 @@ jobs:
strategy:
matrix:
php: ['8.1', '8.0', '7.4']
wordpress: ['6.1', '5.9', '5.6']
wordpress: ['6.2', '6.1', '6.0']
composer_version: ['v2']
include:
- php: '7.4'
wordpress: '5.9'
wordpress: '6.1'
coverage: '--coverage --coverage-xml'
xdebug: 1
xdebug: '2.9.6'
- php: '8.1'
wordpress: '5.6'
wordpress: '6.0'
debug: '--debug'
- php: '7.4'
xdebug: '3.1.6'
- php: '8.0'
xdebug: '3.1.6'
- php: '8.1'
xdebug: '3.2.1'

fail-fast: false
name: WordPress ${{ matrix.wordpress }} on PHP ${{ matrix.php }}
name: Testing QL Events in WordPress v${{ matrix.wordpress }} running on PHP ${{ matrix.php }}
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -45,8 +51,9 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.COMPOSER_TOKEN }}


- name: Install dependencies
env:
WP_VERSION: ${{ matrix.wordpress }}
run: |
cp .env.testing .env
rm -rf composer.lock
Expand All @@ -55,10 +62,9 @@ jobs:

- name: Run Tests w/ Docker.
env:
USING_XDEBUG: ${{ matrix.xdebug }}
XDEBUG_VERSION: ${{ matrix.xdebug }}
WP_VERSION: ${{ matrix.wordpress }}
PHP_VERSION: ${{ matrix.php }}

run: composer run-codeception -- ${{ matrix.coverage }} ${{ matrix.debug }}

- name: Push Codecoverage to Coveralls.io
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ARG PHP_VERSION=7.4

ARG PHP_VERSION
FROM wordpress:php${PHP_VERSION}-apache

ARG XDEBUG_VERSION=2.9.6
Expand All @@ -15,7 +14,8 @@ COPY local/php.ini /usr/local/etc/php/php.ini

# Setup xdebug. The latest version supported by PHP 5.6 is 2.5.5.
RUN pecl install "xdebug-${XDEBUG_VERSION}"; \
docker-php-ext-enable xdebug
docker-php-ext-enable xdebug; \
echo "xdebug.mode=coverage" >> /usr/local/etc/php/conf.d/xdebug.ini;

# Install PDO MySQL driver.
RUN docker-php-ext-install \
Expand Down
66 changes: 66 additions & 0 deletions access-functions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?php
/**
* This file contains access functions for various class methods
*
* @package WPGraphQL\QL_Events
* @since 0.1.0
*/

if ( ! function_exists( 'ql_events_setting' ) ) :
/**
* Get an option value from QL Events settings
*
* @param string $option_name The key of the option to return.
* @param mixed $default The default value the setting should return if no value is set.
* @param string $section_name The settings section name.
*
* @return mixed|string|int|boolean
*/
function ql_events_setting( string $option_name, $default = '', $section_name = 'ql_events_settings' ) {
$section_fields = get_option( $section_name );

/**
* Filter the section fields
*
* @param array $section_fields The values of the fields stored for the section
* @param string $section_name The name of the section
* @param mixed $default The default value for the option being retrieved
*/
$section_fields = apply_filters( 'ql_events_settings_section_fields', $section_fields, $section_name, $default );

/**
* Get the value from the stored data, or return the default
*/
$value = isset( $section_fields[ $option_name ] ) ? $section_fields[ $option_name ] : $default;

/**
* Filter the value before returning it
*
* @param mixed $value The value of the field
* @param mixed $default The default value if there is no value set
* @param string $option_name The name of the option
* @param array $section_fields The setting values within the section
* @param string $section_name The name of the section the setting belongs to
*/
return apply_filters( 'ql_events_settings_section_field_value', $value, $default, $option_name, $section_fields, $section_name );
}
endif;

if ( ! function_exists( 'ql_events_ends_with' ) ) :
/**
* Simple "endsWith" function because PHP still doesn't have on built-in.
*
* @param string $haystack Source string.
* @param string $needle Target substring.
*
* @return bool
*/
function ql_events_ends_with( $haystack, $needle ) {
$length = strlen( $needle );
if ( 0 === $length ) {
return true;
}

return ( substr( $haystack, -$length ) === $needle );
}
endif;
4 changes: 4 additions & 0 deletions codeception.dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ modules:
- events-filterbar/the-events-calendar-filter-view.php
- events-pro/events-calendar-pro.php
- events-virtual/events-virtual.php
- woocommerce/woocommerce.php
- wp-graphql/wp-graphql.php
- wp-graphql-woocommerce/wp-graphql-woocommerce.php
- ql-events/ql-events.php
activatePlugins:
- the-events-calendar/the-events-calendar.php
Expand All @@ -57,6 +59,8 @@ modules:
- events-filterbar/the-events-calendar-filter-view.php
- events-pro/events-calendar-pro.php
- events-virtual/events-virtual.php
- woocommerce/woocommerce.php
- wp-graphql/wp-graphql.php
- wp-graphql-woocommerce/wp-graphql-woocommerce.php
- ql-events/ql-events.php
configFile: 'tests/_data/config.php'
154 changes: 153 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ services:
MYSQL_PASSWORD: password

wordpress:
image: ql-events/wordpress:${WORDPRESS_IMAGE_VERSION:-latest}
image: ql-events/wordpress:${WP_VERSION:-latest}
build:
context: .
args:
PHP_VERSION: ${PHP_VERSION:-8.0}
XDEBUG_VERSION: ${XDEBUG_VERSION:-2.9.6}
depends_on:
- mysql
- mysql_phpunit
Expand Down
Loading