Skip to content

Commit 5a6f76f

Browse files
committed
Merge branch 'trunk' into fix-forum-17945942
2 parents 804f66c + 5dcd596 commit 5a6f76f

File tree

6 files changed

+150
-135
lines changed

6 files changed

+150
-135
lines changed

classes/data-stores/ActionScheduler_wpPostStore_TaxonomyRegistrar.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
/**
44
* Class ActionScheduler_wpPostStore_TaxonomyRegistrar
5+
*
56
* @codeCoverageIgnore
67
*/
78
class ActionScheduler_wpPostStore_TaxonomyRegistrar {
@@ -18,12 +19,12 @@ public function register() {
1819
*/
1920
protected function taxonomy_args() {
2021
$args = array(
21-
'label' => __( 'Action Group', 'action-scheduler' ),
22-
'public' => false,
23-
'hierarchical' => false,
22+
'label' => __( 'Action Group', 'action-scheduler' ),
23+
'public' => false,
24+
'hierarchical' => false,
2425
'show_admin_column' => true,
25-
'query_var' => false,
26-
'rewrite' => false,
26+
'query_var' => false,
27+
'rewrite' => false,
2728
);
2829

2930
$args = apply_filters( 'action_scheduler_taxonomy_args', $args );

classes/migration/DryRun_ActionMigrator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class DryRun_ActionMigrator extends ActionMigrator {
2121
* @return int
2222
*/
2323
public function migrate( $source_action_id ) {
24-
do_action( 'action_scheduler/migrate_action_dry_run', $source_action_id );
24+
do_action( 'action_scheduler/migrate_action_dry_run', $source_action_id ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
2525

2626
return 0;
2727
}

phpcs.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@
4949
</rule>
5050

5151
<rule ref="PEAR.NamingConventions.ValidClassName">
52-
<exclude-pattern>classes/data-stores/ActionScheduler_wpCommentLogger.php</exclude-pattern>
52+
<exclude-pattern>classes/data-stores/ActionScheduler_wpPostStore_TaxonomyRegistrar.php</exclude-pattern>
53+
<exclude-pattern>tests/phpunit/jobstore/ActionScheduler_wpPostStore_Test.php</exclude-pattern>
54+
<exclude-pattern>classes/data-stores/ActionScheduler_wpCommentLogger.php</exclude-pattern>
5355
<exclude-pattern>classes/data-stores/ActionScheduler_wpPostStore_PostTypeRegistrar.php</exclude-pattern>
5456
<exclude-pattern>classes/data-stores/ActionScheduler_wpPostStore.php</exclude-pattern>
5557
<exclude-pattern>classes/ActionScheduler_wcSystemStatus.php</exclude-pattern>

tests/phpunit/jobs/ActionScheduler_Action_Test.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
*/
77
class ActionScheduler_Action_Test extends ActionScheduler_UnitTestCase {
88
public function test_set_schedule() {
9-
$time = as_get_datetime_object();
10-
$schedule = new ActionScheduler_SimpleSchedule($time);
11-
$action = new ActionScheduler_Action( ActionScheduler_Callbacks::HOOK_WITH_CALLBACK, array(), $schedule );
9+
$time = as_get_datetime_object();
10+
$schedule = new ActionScheduler_SimpleSchedule( $time );
11+
$action = new ActionScheduler_Action( ActionScheduler_Callbacks::HOOK_WITH_CALLBACK, array(), $schedule );
1212
$this->assertEquals( $schedule, $action->get_schedule() );
1313
}
1414

@@ -24,31 +24,31 @@ public function test_set_hook() {
2424

2525
public function test_args() {
2626
$action = new ActionScheduler_Action( ActionScheduler_Callbacks::HOOK_WITH_CALLBACK );
27-
$this->assertEmpty($action->get_args());
27+
$this->assertEmpty( $action->get_args() );
2828

2929
$action = new ActionScheduler_Action( ActionScheduler_Callbacks::HOOK_WITH_CALLBACK, array( 5, 10, 15 ) );
30-
$this->assertEqualSets(array(5,10,15), $action->get_args());
30+
$this->assertEqualSets( array( 5, 10, 15 ), $action->get_args() );
3131
}
3232

3333
public function test_set_group() {
34-
$action = new ActionScheduler_Action( ActionScheduler_Callbacks::HOOK_WITH_CALLBACK, array(), NULL, 'my_group' );
35-
$this->assertEquals('my_group', $action->get_group());
34+
$action = new ActionScheduler_Action( ActionScheduler_Callbacks::HOOK_WITH_CALLBACK, array(), null, 'my_group' );
35+
$this->assertEquals( 'my_group', $action->get_group() );
3636
}
3737

3838
public function test_execute() {
3939
$mock = new MockAction();
4040

41-
$random = md5(rand());
41+
$random = md5( wp_rand() );
4242
add_action( $random, array( $mock, 'action' ) );
4343

44-
$action = new ActionScheduler_Action( $random, array($random) );
44+
$action = new ActionScheduler_Action( $random, array( $random ) );
4545
$action->execute();
4646

4747
remove_action( $random, array( $mock, 'action' ) );
4848

4949
$this->assertEquals( 1, $mock->get_call_count() );
5050
$events = $mock->get_events();
51-
$event = reset($events);
52-
$this->assertEquals( $random, reset($event['args']) );
51+
$event = reset( $events );
52+
$this->assertEquals( $random, reset( $event['args'] ) );
5353
}
5454
}

tests/phpunit/jobs/ActionScheduler_NullAction_Test.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ class ActionScheduler_NullAction_Test extends ActionScheduler_UnitTestCase {
88
public function test_null_action() {
99
$action = new ActionScheduler_NullAction();
1010

11-
$this->assertEmpty($action->get_hook());
12-
$this->assertEmpty($action->get_args());
11+
$this->assertEmpty( $action->get_hook() );
12+
$this->assertEmpty( $action->get_args() );
1313
$this->assertNull( $action->get_schedule()->get_date() );
1414
}
1515
}
16-

0 commit comments

Comments
 (0)