MDL-76811 mod_data: strpos check should be strict

This commit is contained in:
Andrew Nicols
2023-01-10 11:19:13 +08:00
parent ee3504f673
commit c26ac2e85d
+3 -1
View File
@@ -118,7 +118,9 @@ class mod_data_generator_testcase extends advanced_testcase {
for ($i = 1; $i < $count; $i++) {
$fieldname = 'field-' . $i;
$this->assertTrue(strpos($addtemplate, '[[' . $fieldname . ']]') >= 0);
$position = strpos($addtemplate, '[[' . $fieldname . ']]');
$this->assertIsNumeric($position);
$this->assertGreaterThanOrEqual(0, $position);
}
}