test(classifier): boundary + array-value tests for has_short_latin_name; @return tags
- Add @return bool to has_valid_email_anywhere docblock
- Add @return bool to has_short_latin_name docblock
- Add Cyrillic note to has_short_latin_name docblock
- Add test_has_short_latin_name_true_for_single_letter_boundary (lower bound)
- Add test_has_short_latin_name_false_for_four_letters_boundary (upper bound)
- Add test_has_short_latin_name_false_for_array_value_with_space_join (regression)
Addresses code review feedback from commit 660a0d2.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -81,4 +81,25 @@ final class ClassifierDropTest extends Cf7stgTestCase
|
||||
$fields = ['text-211' => 'XY', 'text-212' => '+79991234567'];
|
||||
self::assertTrue(Classifier::has_short_latin_name($fields));
|
||||
}
|
||||
|
||||
public function test_has_short_latin_name_true_for_single_letter_boundary(): void
|
||||
{
|
||||
// Lower boundary of {1,3}: 1 char accepted
|
||||
$fields = ['your-name' => 'A'];
|
||||
self::assertTrue(Classifier::has_short_latin_name($fields));
|
||||
}
|
||||
|
||||
public function test_has_short_latin_name_false_for_four_letters_boundary(): void
|
||||
{
|
||||
// Upper boundary of {1,3}: 4 chars rejected
|
||||
$fields = ['your-name' => 'ABCD'];
|
||||
self::assertFalse(Classifier::has_short_latin_name($fields));
|
||||
}
|
||||
|
||||
public function test_has_short_latin_name_false_for_array_value_with_space_join(): void
|
||||
{
|
||||
// pick_field joins array values with a space → "OB MU" is 5 chars → no false positive.
|
||||
$fields = ['your-name' => ['OB', 'MU']];
|
||||
self::assertFalse(Classifier::has_short_latin_name($fields));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user