Skip to content

Commit ea715ad

Browse files
committed
ignore by line or block rather than by file
1 parent 0b8b747 commit ea715ad

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tests/phpunit/logging/ActionScheduler_wpCommentLogger_Test.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?php
2-
// phpcs:disable WordPress.PHP.StrictInArray.MissingTrueStrict
32

43
/**
54
* Class ActionScheduler_wpCommentLogger_Test
@@ -71,6 +70,8 @@ public function test_storage_comments() {
7170
$logger = ActionScheduler::logger();
7271
$logs = $logger->get_logs( $action_id );
7372
$expected = new ActionScheduler_LogEntry( $action_id, 'action created' );
73+
74+
// phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict
7475
$this->assertTrue( in_array( $this->log_entry_to_array( $expected ), $this->log_entry_to_array( $logs ) ) );
7576
}
7677

@@ -102,8 +103,11 @@ public function test_execution_comments() {
102103
$runner->run( 'Unit Tests' );
103104

104105
$logs = $logger->get_logs( $action_id );
106+
107+
// phpcs:disable WordPress.PHP.StrictInArray.MissingTrueStrict
105108
$this->assertTrue( in_array( $this->log_entry_to_array( $started ), $this->log_entry_to_array( $logs ) ) );
106109
$this->assertTrue( in_array( $this->log_entry_to_array( $finished ), $this->log_entry_to_array( $logs ) ) );
110+
// phpcs:enable
107111
}
108112

109113
public function test_failed_execution_comments() {
@@ -120,9 +124,12 @@ public function test_failed_execution_comments() {
120124
$runner->run( 'Unit Tests' );
121125

122126
$logs = $logger->get_logs( $action_id );
127+
128+
// phpcs:disable WordPress.PHP.StrictInArray.MissingTrueStrict
123129
$this->assertTrue( in_array( $this->log_entry_to_array( $started ), $this->log_entry_to_array( $logs ) ) );
124130
$this->assertFalse( in_array( $this->log_entry_to_array( $finished ), $this->log_entry_to_array( $logs ) ) );
125131
$this->assertTrue( in_array( $this->log_entry_to_array( $failed ), $this->log_entry_to_array( $logs ) ) );
132+
// phpcs:enable
126133
}
127134

128135
public function test_failed_schedule_next_instance_comments() {
@@ -137,6 +144,8 @@ public function test_failed_schedule_next_instance_comments() {
137144
}
138145

139146
$logs = $logger->get_logs( $action_id );
147+
148+
// phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict
140149
$this->assertTrue( in_array( $this->log_entry_to_array( $log_entry ), $this->log_entry_to_array( $logs ) ) );
141150
}
142151

@@ -170,6 +179,8 @@ public function test_canceled_action_comments() {
170179
$logger = ActionScheduler::logger();
171180
$logs = $logger->get_logs( $action_id );
172181
$expected = new ActionScheduler_LogEntry( $action_id, 'action canceled' );
182+
183+
// phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict
173184
$this->assertTrue( in_array( $this->log_entry_to_array( $expected ), $this->log_entry_to_array( $logs ) ) );
174185
}
175186

0 commit comments

Comments
 (0)