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

Event Automator Tests merge #2092

Merged
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
9834acb
Event Automator Tests Merge
pattihis May 20, 2024
9f59f32
Merge branch 'bucket/plugin-consolidation' of https://github.com/the-…
pattihis May 21, 2024
77f85d7
Event Automator Tests Merge
pattihis May 22, 2024
34d83e2
Event Automator Tests Merge
pattihis May 22, 2024
ece5d2b
Event Automator Tests Merge
pattihis May 22, 2024
2c97198
Event Automator Tests Merge
pattihis May 22, 2024
9cc95a2
Revert back to old config w plugins.
stratease May 23, 2024
ff71b83
Github Actions changes
pattihis May 23, 2024
1370848
tests bootstrap fix
pattihis May 23, 2024
2759bad
Test Suites Configurations
pattihis May 23, 2024
5220c0c
Switch Uopz Namespace
pattihis May 23, 2024
e822acf
Switch Uopz Namespace
pattihis May 23, 2024
a45caac
EA Tests fixes
pattihis May 25, 2024
49b672a
Update test snapshots
pattihis May 28, 2024
469029a
test(Codeception, wp-browser) update version
lucatume May 28, 2024
e9ce2a9
build(composer.json) restore previous version of Codeception
lucatume May 29, 2024
495555a
test(EVA) update, refactor, fix
lucatume May 29, 2024
4c14714
Merge branch 'bucket/plugin-consolidation' of https://github.com/the-…
pattihis May 29, 2024
027978f
wpunit tests
pattihis May 29, 2024
15c0dcf
typo
pattihis May 29, 2024
6b2a050
Move EVA tests to own suite
pattihis May 29, 2024
bc150de
Different bootstrap per suite
pattihis May 29, 2024
36a3304
fix wpunit.suite.dist.yml
pattihis May 29, 2024
564e459
force wp version 6.4
pattihis May 29, 2024
57c3025
Fix Activation Test
pattihis May 30, 2024
3d421ec
Fix Snapshot Test
pattihis May 30, 2024
e6cca40
test(empty.sql) update db version
lucatume May 31, 2024
e9ce97f
Merge branch 'bucket/plugin-consolidation' of https://github.com/the-…
pattihis May 31, 2024
939ac3f
fix double quotes issue
pattihis May 31, 2024
c52089b
fix EDD plugin activation
pattihis May 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
436 changes: 261 additions & 175 deletions .github/workflows/tests-php.yml

Large diffs are not rendered by default.

74 changes: 74 additions & 0 deletions tests/_bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,77 @@
Autoload::addNamespace( 'Tribe\\Tests', __DIR__ . '/_support' );
// Silence the logger in the tests.
$_ENV['TEC_DISABLE_LOGGING'] = 1;


/**
* Bootstrap for Event Automator Tests.
*
*/

// TEC Test Support.
$tec_dir = dirname( __DIR__, 2 );
$tec_tests_dir = $tec_dir . '/tests';
$tec_support_dir = $tec_tests_dir . '/_support';
if ( ! is_dir( $tec_tests_dir ) ) {
throw new RuntimeException( "Event Automator tests require The Events Calendar installed in a \"the-events-calendar\" sibling folder: {$tec_tests_dir} not found." );
}

// ET Test Support.
$et_dir = dirname( __DIR__, 3 ) . '/event-tickets';
$et_tests_dir = $et_dir . '/tests';
$et_support_dir = $et_tests_dir . '/_support';
if ( ! is_dir( $et_tests_dir ) ) {
throw new RuntimeException( "Event Automator tests require Event Tickets installed in a \"event-tickets\" sibling folder: {$et_tests_dir} not found." );
}

// ET+ Test Support.
$etplus_dir = dirname( __DIR__, 3 ) . '/event-tickets-plus';
$etplus_tests_dir = $etplus_dir . '/tests';
$etplus_support_dir = $etplus_tests_dir . '/_support';
if ( ! is_dir( $etplus_tests_dir ) ) {
throw new RuntimeException( "Event Automator tests require Event Tickets Plus installed in a \"event-tickets-plus\" sibling folder: {$etplus_tests_dir} not found." );
}

/**
* Manually include the file here as we might need it in a suite configuration file.
* Suites fire before the autoload below is used so we need to gather what we need without
* autoloading.
*/
require_once $tec_support_dir . '/Helper/TribeDb.php';

Autoload::addNamespace( '\\Tribe\\Events\\Test', $tec_support_dir );
Autoload::addNamespace( '\\Helper', $tec_support_dir );
Autoload::addNamespace( '\\TEC\\Event_Automator\\Tests', __DIR__ . '/_support' );
Autoload::addNamespace( '\\Tribe\\Extensions', __DIR__ . '/_data/classes/Tribe/Extensions' );
Autoload::addNamespace( '\Tribe\Tickets\Test', $et_support_dir );
Autoload::addNamespace( '\Tribe\Tickets_Plus\Test', $etplus_support_dir );


/**
* Codeception will regenerate snapshots on `--debug`, while the `spatie/snapshot-assertions`
* library will do the same on `--update-snapshots`.
* Since Codeception has strict check on the CLI arguments appending `--update-snapshots` to the
* `vendor/bin/codecept run` command will throw an error.
* We handle that intention here.
*/
if ( in_array( '--debug', $_SERVER['argv'], true ) ) {
$_SERVER['argv'][] = '--update-snapshots';
}

// If the `uopz` extension is installed, then ensure `exit` and `die` to work normally.
if ( function_exists( 'uopz_allow_exit' ) ) {
uopz_allow_exit( true );
}

// Let's make sure Tickets Commerce is activated.
putenv( 'TEC_TICKETS_COMMERCE=1' );
$_ENV['TEC_TICKETS_COMMERCE'] = 1;

// Disabled SSL check.
putenv( 'TEC_EVENT_AUTOMATOR_INTEGRATION_SSL_DISABLED=1' );
$_ENV['TEC_EVENT_AUTOMATOR_INTEGRATION_SSL_DISABLED'] = 1;


// By default, do not enable the Custom Tables v1 implementation in tests.
putenv( 'TEC_CUSTOM_TABLES_V1_DISABLED=1' );
$_ENV['TEC_CUSTOM_TABLES_V1_DISABLED'] = 1;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"consumer_id": "2ed61a7fd3ec668ec3e82e00f22e0c8230d353a5",
"consumer_secret": "e712e1a4a698214c3537016f633e06cc8fcbbd0e",
"has_pair": "true",
"permissions": "read",
"last_access": "2022-10-18 06:35:55",
"user_id": "1",
"name": "Automated Tests PA 15"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"consumer_id": "efbe2a4f41ad592da9afe3cef24a5b358e9c6ab395e8c86e39593ab7a374815b",
"consumer_secret": "f1c9b5d880695649df16689a39d574fb0802150397d9728c511c8fcc87415c29",
"has_pair": "true",
"permissions": "read",
"last_access": "",
"user_id": "1",
"name": "Automated Tests PA 1"
}
8 changes: 8 additions & 0 deletions tests/_data/Power_Automate/Endpoints/attendee.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "attendees",
"display_name": "Attendees",
"type" : "queue",
"last_access" : "",
"count" : "5",
"enabled" : "true"
}
8 changes: 8 additions & 0 deletions tests/_data/Power_Automate/Endpoints/canceled_events.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "canceled_events",
"display_name": "Canceled Events",
"type" : "queue",
"last_access" : "",
"count" : "8",
"enabled" : "true"
}
8 changes: 8 additions & 0 deletions tests/_data/Power_Automate/Endpoints/checkin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "checkin",
"display_name": "Checkin",
"type" : "queue",
"last_access" : "",
"count" : "5",
"enabled" : "true"
}
8 changes: 8 additions & 0 deletions tests/_data/Power_Automate/Endpoints/new_events.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "new_events",
"display_name": "New Events",
"type" : "queue",
"last_access" : "",
"count" : "7",
"enabled" : "true"
}
8 changes: 8 additions & 0 deletions tests/_data/Power_Automate/Endpoints/orders.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "orders",
"display_name": "Orders",
"type" : "queue",
"last_access" : "",
"count" : "23",
"enabled" : "true"
}
8 changes: 8 additions & 0 deletions tests/_data/Power_Automate/Endpoints/refunded_orders.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "refunded_orders",
"display_name": "Refunded Orders",
"type" : "queue",
"last_access" : "",
"count" : "3",
"enabled" : "true"
}
8 changes: 8 additions & 0 deletions tests/_data/Power_Automate/Endpoints/updated_attendee.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "updated_attendees",
"display_name": "Updated Attendees",
"type" : "queue",
"last_access" : "",
"count" : "7",
"enabled" : "true"
}
8 changes: 8 additions & 0 deletions tests/_data/Power_Automate/Endpoints/updated_events.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "updated_events",
"display_name": "Updated Events",
"type" : "queue",
"last_access" : "",
"count" : "3",
"enabled" : "true"
}
9 changes: 9 additions & 0 deletions tests/_data/Zapier/API-Keys/200-account-valid-key-pair-2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"consumer_id": "2ed61a7fd3ec668ec3e82e00f22e0c8230d353a5",
"consumer_secret": "e712e1a4a698214c3537016f633e06cc8fcbbd0e",
"has_pair": "true",
"permissions": "read",
"last_access": "2022-10-18 06:35:55",
"user_id": "1",
"name": "Automated Tests 12"
}
9 changes: 9 additions & 0 deletions tests/_data/Zapier/API-Keys/200-account-valid-key-pair.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"consumer_id": "efbe2a4f41ad592da9afe3cef24a5b358e9c6ab395e8c86e39593ab7a374815b",
"consumer_secret": "f1c9b5d880695649df16689a39d574fb0802150397d9728c511c8fcc87415c29",
"has_pair": "true",
"permissions": "read",
"last_access": "",
"user_id": "1",
"name": "Automated Tests 1"
}
8 changes: 8 additions & 0 deletions tests/_data/Zapier/Endpoints/attendee.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "attendees",
"display_name": "Attendees",
"type" : "queue",
"last_access" : "",
"count" : "5",
"enabled" : "true"
}
8 changes: 8 additions & 0 deletions tests/_data/Zapier/Endpoints/authorize.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "authorize",
"display_name": "Authorize",
"type" : "authorize",
"last_access" : "",
"count" : "0",
"enabled" : "true"
}
8 changes: 8 additions & 0 deletions tests/_data/Zapier/Endpoints/canceled_events.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "canceled_events",
"display_name": "Canceled Events",
"type" : "queue",
"last_access" : "",
"count" : "8",
"enabled" : "true"
}
8 changes: 8 additions & 0 deletions tests/_data/Zapier/Endpoints/checkin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "checkin",
"display_name": "Checkin",
"type" : "queue",
"last_access" : "",
"count" : "5",
"enabled" : "true"
}
8 changes: 8 additions & 0 deletions tests/_data/Zapier/Endpoints/new_events.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "new_events",
"display_name": "New Events",
"type" : "queue",
"last_access" : "",
"count" : "7",
"enabled" : "true"
}
8 changes: 8 additions & 0 deletions tests/_data/Zapier/Endpoints/orders.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "orders",
"display_name": "Orders",
"type" : "queue",
"last_access" : "",
"count" : "23",
"enabled" : "true"
}
8 changes: 8 additions & 0 deletions tests/_data/Zapier/Endpoints/refunded_orders.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "refunded_orders",
"display_name": "Refunded Orders",
"type" : "queue",
"last_access" : "",
"count" : "3",
"enabled" : "true"
}
8 changes: 8 additions & 0 deletions tests/_data/Zapier/Endpoints/updated_attendee.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "updated_attendees",
"display_name": "Updated Attendees",
"type" : "queue",
"last_access" : "",
"count" : "5",
"enabled" : "true"
}
8 changes: 8 additions & 0 deletions tests/_data/Zapier/Endpoints/updated_events.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "updated_events",
"display_name": "Updated Events",
"type" : "queue",
"last_access" : "",
"count" : "3",
"enabled" : "true"
}
Loading
Loading