Skip to content

Commit df7e8d5

Browse files
authored
Merge pull request #9 from amaccis/upgrade_3.0.0
Upgrade 3.0.0
2 parents dfc3c0a + 6d05b86 commit df7e8d5

File tree

5 files changed

+48
-62
lines changed

5 files changed

+48
-62
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
max-parallel: 1
1515
matrix:
1616
container:
17-
- "amaccis/php-libstemmer:8.1.31-2.2.0"
18-
- "amaccis/php-libstemmer:8.2.27-2.2.0"
19-
- "amaccis/php-libstemmer:8.3.15-2.2.0"
20-
- "amaccis/php-libstemmer:8.4.2-2.2.0"
17+
- "amaccis/php-libstemmer:8.1.32-3.0.0"
18+
- "amaccis/php-libstemmer:8.2.28-3.0.0"
19+
- "amaccis/php-libstemmer:8.3.20-3.0.0"
20+
- "amaccis/php-libstemmer:8.4.6-3.0.0"
2121

2222
container:
2323
image: ${{ matrix.container }}

composer.lock

Lines changed: 26 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpunit.xml.dist

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
2+
<phpunit
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
bootstrap="vendor/autoload.php"
5+
backupGlobals="false"
6+
colors="true"
7+
processIsolation="false"
8+
stopOnFailure="false"
9+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd"
10+
cacheDirectory=".phpunit.cache"
11+
backupStaticProperties="false"
12+
displayDetailsOnTestsThatTriggerDeprecations="true">
313
<coverage/>
414
<testsuites>
515
<testsuite name="Tests">

src/Adapter/Libstemmer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ public function sbStemmerDelete(CData $sbStemmer): void
5151
public function sbStemmerStem(CData $sbStemmer, string $word, int $size): CData
5252
{
5353

54-
$c_word = FFI::new("char[$size]");
54+
$c_word = $this->ffi->new("char[$size]");
5555
FFI::memcpy($c_word, $word, $size);
56-
$sb_symbol = FFI::cast($this->ffi->type('sb_symbol'), $c_word);
56+
$sb_symbol = $this->ffi->cast($this->ffi->type('sb_symbol'), $c_word);
5757
$word = FFI::addr($sb_symbol);
5858

5959
return $this->ffi->sb_stemmer_stem($sbStemmer, $word, $size);

tests/StemmerTest.php

Lines changed: 5 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -11,42 +11,12 @@
1111
class StemmerTest extends TestCase
1212
{
1313

14-
public function testThatAlgorithmsReturnsTheExpectedArray(): void
14+
public function testThatAlgorithmsReturnsAnArrayNotEmpty(): void
1515
{
1616

17-
$expectedAlgorithms = [
18-
'arabic',
19-
'armenian',
20-
'basque',
21-
'catalan',
22-
'danish',
23-
'dutch',
24-
'english',
25-
'finnish',
26-
'french',
27-
'german',
28-
'greek',
29-
'hindi',
30-
'hungarian',
31-
'indonesian',
32-
'irish',
33-
'italian',
34-
'lithuanian',
35-
'nepali',
36-
'norwegian',
37-
'porter',
38-
'portuguese',
39-
'romanian',
40-
'russian',
41-
'serbian',
42-
'spanish',
43-
'swedish',
44-
'tamil',
45-
'turkish',
46-
'yiddish'
47-
];
4817
$algorithms = Stemmer::algorithms();
49-
$this->assertEquals($expectedAlgorithms, $algorithms);
18+
$this->assertIsArray($algorithms);
19+
$this->assertNotEmpty($algorithms);
5020

5121
}
5222

@@ -114,7 +84,7 @@ public static function stemWordUtf8CharencProvider(): array
11484
['catalan', 'arruïnada', 'arru'],
11585
['danish', 'afbildningerne', 'afbildning'],
11686
['hungarian', 'lenyűgözőnek', 'lenyűgöző'],
117-
['romanian', 'luminişurile', 'luminişur'],
87+
['romanian', 'luminișurile', 'luminișur'],
11888
['russian', 'взъерошенный', 'взъерошен']
11989
];
12090

@@ -174,7 +144,6 @@ public static function stemWordIso88592CharencProvider(): array
174144

175145
return [
176146
['hungarian', 'lenyűgözőnek', 'lenyűgöző'],
177-
['romanian', 'luminişurile', 'luminişur'],
178147
];
179148

180149
}
@@ -250,7 +219,7 @@ public static function stemWordsUtf8CharencProvider(): array
250219
['catalan', ['gratuïtament', 'cuaespinós'], ['gratuit', 'cuaespin']],
251220
['danish', ['afbildningerne', 'linnedklæderne'], ['afbildning', 'linnedklæd']],
252221
['hungarian', ['lenyűgözőnek', 'megháromszorozódott'], ['lenyűgöző', 'megháromszorozódot']],
253-
['romanian', ['luminişurile', 'personalităţilor'], ['luminişur', 'personal']],
222+
['romanian', ['luminișurile', 'personalităţilor'], ['luminișur', 'personal']],
254223
['russian', ['взъерошенный', 'затруднительное'], ['взъерошен', 'затруднительн']],
255224
];
256225

@@ -320,7 +289,6 @@ public static function stemWordsIso88592CharencProvider(): array
320289

321290
return [
322291
['hungarian', ['lenyűgözőnek', 'megháromszorozódott'], ['lenyűgöző', 'megháromszorozódot']],
323-
['romanian', ['luminişurile', 'personalităţilor'], ['luminişur', 'personal']],
324292
];
325293

326294
}

0 commit comments

Comments
 (0)