-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding Reset_Data_Structures trait (#538)
- Loading branch information
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
src/mantle/testing/concerns/trait-reset-data-structures.php
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,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(); | ||
} | ||
} |