-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #696 from godaddy-wordpress/mwc-17264/t-c-checkout…
…-page Set the payment form context in the session
- Loading branch information
Showing
19 changed files
with
1,082 additions
and
328 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: CI | ||
|
||
on: | ||
workflow_dispatch: # Can manually run from any branch | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
# Cancel previous jobs before starting this one. Works on pull_request event only due to use of head_ref. | ||
# https://docs.github.com/en/actions/using-jobs/using-concurrency | ||
concurrency: | ||
group: ${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
php-tests: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
include: | ||
- php: '8.3' | ||
os: 'ubuntu-24.04' | ||
- php: '8.2' | ||
os: 'ubuntu-20.04' | ||
- php: '8.1' | ||
os: 'ubuntu-latest' | ||
- php: '8.0' | ||
os: 'ubuntu-20.04' | ||
- php: '7.4' | ||
os: 'ubuntu-20.04' | ||
fail-fast: false | ||
env: | ||
COVERAGE_CACHE_PATH: phpunit-coverage-cache | ||
PHP_VERSION: ${{ matrix.php }} | ||
|
||
steps: | ||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
|
||
- name: Switch to PHP ${{ env.PHP_VERSION }} | ||
run: | | ||
sudo update-alternatives --set php /usr/bin/php$PHP_VERSION | ||
sudo update-alternatives --set phar /usr/bin/phar$PHP_VERSION | ||
sudo update-alternatives --set phar.phar /usr/bin/phar.phar$PHP_VERSION | ||
sudo update-alternatives --set phpize /usr/bin/phpize$PHP_VERSION | ||
sudo update-alternatives --set php-config /usr/bin/php-config$PHP_VERSION | ||
- name: Get Composer Cache Directory | ||
id: composer-cache | ||
run: | | ||
echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-composer- | ||
- name: Install Dependencies | ||
run: | | ||
composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist | ||
- name: Check platform requirements on PHP ${{ env.PHP_VERSION }} | ||
run: | | ||
composer check-platform-reqs --no-dev --no-interaction --no-scripts | ||
- name: Execute tests via PHPUnit | ||
env: | ||
DB_CONNECTION: sqlite | ||
DB_DATABASE: database/database.sqlite | ||
run: | | ||
vendor/bin/phpunit --order-by="random" --coverage-text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,3 +25,4 @@ npm-debug.log | |
codeception.yml | ||
.env | ||
/tests/_data/dump.sql | ||
.phpunit.cache/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd" | ||
bootstrap="tests/bootstrap.php" | ||
colors="true" | ||
cacheResultFile=".phpunit.cache/test-results" | ||
executionOrder="depends,defects" | ||
forceCoversAnnotation="true" | ||
beStrictAboutCoversAnnotation="false" | ||
beStrictAboutOutputDuringTests="true" | ||
beStrictAboutTodoAnnotatedTests="true" | ||
convertDeprecationsToExceptions="true" | ||
failOnRisky="true" | ||
failOnWarning="true" | ||
verbose="true"> | ||
<testsuites> | ||
<testsuite name="Unit"> | ||
<directory suffix="Test.php">./tests/unit</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<coverage cacheDirectory=".phpunit.cache/code-coverage" | ||
disableCodeCoverageIgnore="true" | ||
includeUncoveredFiles="true" | ||
ignoreDeprecatedCodeUnits="true" | ||
processUncoveredFiles="false"> | ||
<include> | ||
<directory suffix=".php">./src</directory> | ||
</include> | ||
</coverage> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
namespace SkyVerge\WooCommerce\PluginFramework\v5_13_0\Tests; | ||
|
||
use WP_Mock\Tools\TestCase as WpMockTestCase; | ||
|
||
class TestCase extends WpMockTestCase | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
const ABSPATH = 'foo/bar'; | ||
|
||
define('PLUGIN_ROOT_DIR', dirname(__DIR__)); | ||
|
||
require_once PLUGIN_ROOT_DIR.'/vendor/autoload.php'; | ||
require_once PLUGIN_ROOT_DIR.'/woocommerce/class-sv-wc-plugin.php'; | ||
require_once PLUGIN_ROOT_DIR.'/woocommerce/class-sv-wc-plugin-exception.php'; | ||
require_once PLUGIN_ROOT_DIR.'/woocommerce/Enums/Traits/EnumTrait.php'; | ||
require_once PLUGIN_ROOT_DIR.'/woocommerce/Enums/PaymentFormContext.php'; | ||
|
||
WP_Mock::setUsePatchwork(true); | ||
WP_Mock::bootstrap(); | ||
|
||
require_once PLUGIN_ROOT_DIR.'/woocommerce/class-sv-wc-helper.php'; |
Oops, something went wrong.