Skip to content

Commit

Permalink
Changes because of stellarwp/schema update
Browse files Browse the repository at this point in the history
  • Loading branch information
dpanta94 committed Feb 13, 2025
1 parent 0735774 commit 0e0fcf6
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 28 deletions.
4 changes: 2 additions & 2 deletions src/Tickets/Seating/Service/Layouts.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,8 @@ public static function invalidate_cache( bool $truncate = true ): bool {
$invalidated = true;

if ( $truncate ) {
$invalidated &= tribe( Layouts_Table::class )->truncate() !== false &&
tribe( Seat_Types_Table::class )->truncate() !== false;
$invalidated &= tribe( Layouts_Table::class )->empty_table() !== false &&
tribe( Seat_Types_Table::class )->empty_table() !== false;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Tickets/Seating/Service/Maps.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static function invalidate_cache(): bool {
delete_transient( self::update_transient_name() );
wp_cache_delete( 'option_map_card_objects', 'tec-tickets-seating' );

$invalidated = tribe( Maps_Table::class )->truncate() !== false;
$invalidated = tribe( Maps_Table::class )->empty_table() !== false;

/**
* Fires after the caches and custom tables storing information about Maps have been
Expand Down
2 changes: 1 addition & 1 deletion src/Tickets/Seating/Service/Seat_Types.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public function update( bool $force = false ): bool {
);

$updated = $updater->check_last_update( $force )
->update_from_service( fn() => tribe( Seat_Types_Table::class )->truncate() )
->update_from_service( fn() => tribe( Seat_Types_Table::class )->empty_table() )
->store_fetched_data( [ $this, 'insert_rows_from_service' ] );

return $updated;
Expand Down
8 changes: 4 additions & 4 deletions src/Tickets/Seating/Uplink.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,10 @@ public function render_legend_before_input( string $field_id ): void {
*/
public function reset_data_on_new_connection() {
// Truncate tables.
tribe( Maps::class )->truncate();
tribe( Layouts::class )->truncate();
tribe( Seat_Types::class )->truncate();
tribe( Sessions::class )->truncate();
tribe( Maps::class )->empty_table();
tribe( Layouts::class )->empty_table();
tribe( Seat_Types::class )->empty_table();
tribe( Sessions::class )->empty_table();

// Clear cache.
tribe( Service\Maps::class )->invalidate_cache();
Expand Down
6 changes: 3 additions & 3 deletions tests/_support/Commerce/OrderModifiers/Fee_Creator.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ public function reset_counter() {
* @after
*/
public function truncate_custom_tables() {
$this->assertTrue( tribe( Relationships_Table::class )->truncate() );
$this->assertTrue( tribe( Meta_Table::class )->truncate() );
$this->assertTrue( tribe( Modifiers_Table::class )->truncate() );
$this->assertTrue( tribe( Relationships_Table::class )->empty_table() );
$this->assertTrue( tribe( Meta_Table::class )->empty_table() );
$this->assertTrue( tribe( Modifiers_Table::class )->empty_table() );
}

/**
Expand Down
8 changes: 4 additions & 4 deletions tests/slr_ecp_integration/_bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@
tribe()->get( \TEC\Tickets\Seating\Service\Service::class );

tribe()->get( Maps::class )->update();
tribe()->get( Maps::class )->truncate();
tribe()->get( Maps::class )->empty_table();
tribe()->get( Layouts::class )->update();
tribe()->get( Layouts::class )->truncate();
tribe()->get( Layouts::class )->empty_table();
tribe()->get( Seat_Types::class )->update();
tribe()->get( Seat_Types::class )->truncate();
tribe()->get( Seat_Types::class )->empty_table();
tribe()->get( Sessions::class )->update();
tribe()->get( Sessions::class )->truncate();
tribe()->get( Sessions::class )->empty_table();

define( 'JSON_SNAPSHOT_OPTIONS', JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES );

Expand Down
8 changes: 4 additions & 4 deletions tests/slr_integration/Admin/Ajax_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ public function reset_tribe_options_cache(): void {
* @after
*/
public function truncate_tables(): void {
tribe( Maps::class )->truncate();
tribe( Seat_Types_Table::class )->truncate();
tribe( Layouts_Table::class )->truncate();
tribe( Sessions::class )->truncate();
tribe( Maps::class )->empty_table();
tribe( Seat_Types_Table::class )->empty_table();
tribe( Layouts_Table::class )->empty_table();
tribe( Sessions::class )->empty_table();
}

public function asset_data_provider() {
Expand Down
6 changes: 3 additions & 3 deletions tests/slr_integration/Admin/Maps_Layout_Homepage_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ public function mock_user() {
* @after
*/
public function truncate_tables():void{
tribe( Maps_Table::class )->truncate();
tribe( Layouts_Table::class )->truncate();
tribe( Seat_Types_Table::class )->truncate();
tribe( Maps_Table::class )->empty_table();
tribe( Layouts_Table::class )->empty_table();
tribe( Seat_Types_Table::class )->empty_table();
}

public function test_empty_seating_configurations(): void {
Expand Down
2 changes: 1 addition & 1 deletion tests/slr_integration/Orders/Cart_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Cart_Test extends WPTestCase {
* @after
*/
public function truncate_tables(): void {
tribe( Sessions_Table::class )->truncate();
tribe( Sessions_Table::class )->empty_table();
}

public function test_save_seat_data_for_attendee():void{
Expand Down
2 changes: 1 addition & 1 deletion tests/slr_integration/Service/Seat_Types_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function set_up_tickets_commerce(): void {
* @after
*/
public function clean_up(): void {
tribe( Seat_Types_Table::class )->truncate();
tribe( Seat_Types_Table::class )->empty_table();
}

public function test_update_from_service(): void {
Expand Down
8 changes: 4 additions & 4 deletions tests/slr_integration/_bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
tribe()->get( \TEC\Tickets\Seating\Service\Service::class );

tribe()->get( Maps::class )->update();
tribe()->get( Maps::class )->truncate();
tribe()->get( Maps::class )->empty_table();
tribe()->get( Layouts::class )->update();
tribe()->get( Layouts::class )->truncate();
tribe()->get( Layouts::class )->empty_table();
tribe()->get( Seat_Types::class )->update();
tribe()->get( Seat_Types::class )->truncate();
tribe()->get( Seat_Types::class )->empty_table();
tribe()->get( Sessions::class )->update();
tribe()->get( Sessions::class )->truncate();
tribe()->get( Sessions::class )->empty_table();

define( 'JSON_SNAPSHOT_OPTIONS', JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES );

Expand Down

0 comments on commit 0e0fcf6

Please sign in to comment.