Skip to content

Commit de0b668

Browse files
committed
test: reorder assertions to guard strpos calls
1 parent fa70566 commit de0b668

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/unit-tests/class-test-copyright-date-block.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,15 +165,15 @@ public function test_render_parts_order() {
165165
]
166166
);
167167

168+
$this->assertStringContainsString( '</span> <span class="' . $this->block_class . '__year">', $output, 'Space should separate prefix and year.' );
169+
$this->assertStringContainsString( '</span> <span class="' . $this->block_class . '__suffix">', $output, 'Space should separate year and suffix.' );
170+
168171
$prefix_pos = strpos( $output, $this->block_class . '__prefix' );
169172
$year_pos = strpos( $output, $this->block_class . '__year' );
170173
$suffix_pos = strpos( $output, $this->block_class . '__suffix' );
171174

172175
$this->assertGreaterThan( $prefix_pos, $year_pos, 'Year should appear after prefix.' );
173176
$this->assertGreaterThan( $year_pos, $suffix_pos, 'Suffix should appear after year.' );
174-
175-
$this->assertStringContainsString( '</span> <span class="' . $this->block_class . '__year">', $output, 'Space should separate prefix and year.' );
176-
$this->assertStringContainsString( '</span> <span class="' . $this->block_class . '__suffix">', $output, 'Space should separate year and suffix.' );
177177
}
178178

179179
/**

0 commit comments

Comments
 (0)