Skip to content

Commit

Permalink
Adding Reset_Data_Structures trait (#538)
Browse files Browse the repository at this point in the history
  • Loading branch information
srtfisher authored Apr 25, 2024
1 parent a4217ee commit 5739bc9
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/mantle/testing/concerns/trait-reset-data-structures.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
/**
* Reset_Data_Structures trait file
*
* @package Mantle
*/

namespace Mantle\Testing\Concerns;

/**
* Reset the data structures on set up.
*
* When the trait is used it will reset the post types and taxonomies back to
* their original state for each test run.
*/
trait Reset_Data_Structures {
use WordPress_State;

/**
* Reset the data structures on set up.
*/
public function reset_data_structures_set_up(): void {
$this->reset_post_types();
$this->reset_taxonomies();
}
}

0 comments on commit 5739bc9

Please sign in to comment.