Skip to content

Commit ea1e2a8

Browse files
committed
Less randomness
1 parent ebd7e2f commit ea1e2a8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/TextCatTest.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,12 @@ public function testCreateFromTexts($textFile, $lmFile)
9191
public function testFileLines($textFile)
9292
{
9393
$lines = file($textFile);
94+
$line = 5;
9495
do {
95-
$randLine = trim($lines[array_rand($lines)]);
96-
} while(empty($randLine));
97-
$detect = $this->testcat->classify($randLine);
96+
$testLine = trim($lines[$line]);
97+
$line++;
98+
} while(empty($testLine));
99+
$detect = $this->testcat->classify($testLine);
98100
reset($detect);
99101
$this->assertEquals(basename($textFile, ".txt"), key($detect));
100102
}

0 commit comments

Comments
 (0)