Skip to content

Commit

Permalink
Add @group annotations for tests around Intervals
Browse files Browse the repository at this point in the history
  • Loading branch information
stevegrunwell committed Apr 27, 2020
1 parent e88d174 commit 24c3cc5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/OrderLimiterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public function reset_wc_notices() {
/**
* @test
* @testdox get_interval() should return the interval setting
* @group Intervals
*/
public function get_interval_should_return_the_interval_setting() {
update_option( OrderLimiter::OPTION_KEY, [
Expand Down Expand Up @@ -206,6 +207,7 @@ public function get_remaining_orders_should_return_zero_if_limits_are_met_or_exc

/**
* @test
* @group Intervals
*/
public function get_interval_start_for_daily() {
update_option( OrderLimiter::OPTION_KEY, [
Expand All @@ -224,6 +226,7 @@ public function get_interval_start_for_daily() {

/**
* @test
* @group Intervals
*/
public function get_interval_start_for_weekly() {
update_option( 'week_starts_on', 1 );
Expand All @@ -244,6 +247,7 @@ public function get_interval_start_for_weekly() {

/**
* @test
* @group Intervals
*/
public function get_interval_start_for_weekly_with_a_non_standard_day() {
update_option( 'week_starts_on', 6 );
Expand All @@ -264,6 +268,7 @@ public function get_interval_start_for_weekly_with_a_non_standard_day() {

/**
* @test
* @group Intervals
*/
public function get_interval_start_for_weekly_when_today_is_the_first_day_of_the_week() {
update_option( 'week_starts_on', 1 );
Expand All @@ -284,6 +289,7 @@ public function get_interval_start_for_weekly_when_today_is_the_first_day_of_the

/**
* @test
* @group Intervals
*/
public function get_interval_start_for_monthly() {
$today = new \DateTimeImmutable( 'now', wp_timezone() );
Expand All @@ -301,6 +307,7 @@ public function get_interval_start_for_monthly() {

/**
* @test
* @group Intervals
*/
public function get_interval_start_should_be_idempotent() {
$now = new \DateTimeImmutable( '00:00:00', wp_timezone() );
Expand All @@ -320,6 +327,7 @@ public function get_interval_start_should_be_idempotent() {

/**
* @test
* @group Intervals
*/
public function get_next_interval_start_for_daily() {
update_option( OrderLimiter::OPTION_KEY, [
Expand All @@ -339,6 +347,7 @@ public function get_next_interval_start_for_daily() {

/**
* @test
* @group Intervals
*/
public function get_next_interval_start_for_weekly() {
update_option( 'week_starts_on', 1 );
Expand All @@ -359,6 +368,7 @@ public function get_next_interval_start_for_weekly() {

/**
* @test
* @group Intervals
*/
public function get_next_interval_start_for_monthly() {
update_option( OrderLimiter::OPTION_KEY, [
Expand All @@ -378,6 +388,7 @@ public function get_next_interval_start_for_monthly() {

/**
* @test
* @group Intervals
*/
public function get_seconds_until_next_interval_for_daily() {
update_option( OrderLimiter::OPTION_KEY, [
Expand All @@ -397,6 +408,7 @@ public function get_seconds_until_next_interval_for_daily() {

/**
* @test
* @group Intervals
*/
public function get_seconds_until_next_interval_for_weekly() {
update_option( 'week_starts_on', 1 );
Expand All @@ -417,6 +429,7 @@ public function get_seconds_until_next_interval_for_weekly() {

/**
* @test
* @group Intervals
*/
public function get_seconds_until_next_interval_for_monthly() {
update_option( OrderLimiter::OPTION_KEY, [
Expand Down
1 change: 1 addition & 0 deletions tests/SettingsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public function the_options_should_be_added_to_their_own_page() {

/**
* @test
* @group Intervals
*/
public function available_intervals_should_be_filterable() {
$intervals = [
Expand Down

0 comments on commit 24c3cc5

Please sign in to comment.