mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 17:58:41 +00:00
fix tests
This commit is contained in:
parent
6805b24820
commit
0c612c339d
|
|
@ -96,12 +96,15 @@ abstract class NgramParser
|
|||
|
||||
for ($i = $this->minLength; $i <= $this->maxLength; ++$i) {
|
||||
for ($j = 0; ($i + $j - 1) < $l; ++$j, ++$tmp) {
|
||||
$tmp = &$tokens[$i][\mb_substr($word, $j, $i)];
|
||||
if (!isset($tokens[$i][$char = \mb_substr($word, $j, $i)])) {
|
||||
$tokens[$i][$char] = 0;
|
||||
}
|
||||
|
||||
$tmp = &$tokens[$i][$char];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** @phpstan-ignore-next-line */
|
||||
foreach ($tokens as $i => $token) {
|
||||
$sum = \array_sum($token);
|
||||
|
||||
|
|
@ -110,14 +113,12 @@ abstract class NgramParser
|
|||
}
|
||||
}
|
||||
|
||||
/** @phpstan-ignore-next-line */
|
||||
if (empty($tokens)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$tokens = \array_merge(...$tokens);
|
||||
|
||||
/** @phpstan-ignore-next-line */
|
||||
if (isset($tokens['_'])) {
|
||||
unset($tokens['_']);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ final class MysqlGrammarTest extends \PHPUnit\Framework\TestCase
|
|||
protected function setUp() : void
|
||||
{
|
||||
$this->con = new MysqlConnection($GLOBALS['CONFIG']['db']['core']['masters']['admin']);
|
||||
$this->con->connect();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user