-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
574: Changes related to the next Meilisearch release (v1.4.0) r=curquiza a=alallema related to: meilisearch/integration-guides#286 Co-authored-by: alallema <[email protected]> Co-authored-by: Bruno Casali <[email protected]> Co-authored-by: Clémentine U. - curqui <[email protected]>
- Loading branch information
Showing
6 changed files
with
249 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Tests\Settings; | ||
|
||
use Meilisearch\Endpoints\Indexes; | ||
use Tests\TestCase; | ||
|
||
final class NonSeparatorTokensTest extends TestCase | ||
{ | ||
private Indexes $index; | ||
|
||
public const DEFAULT_NON_SEPARATOR_TOKENS = []; | ||
|
||
protected function setUp(): void | ||
{ | ||
parent::setUp(); | ||
$this->index = $this->createEmptyIndex($this->safeIndexName()); | ||
} | ||
|
||
public function testGetDefaultNonSeparatorTokens(): void | ||
{ | ||
$response = $this->index->getNonSeparatorTokens(); | ||
|
||
$this->assertEquals(self::DEFAULT_NON_SEPARATOR_TOKENS, $response); | ||
} | ||
|
||
public function testUpdateNonSeparatorTokens(): void | ||
{ | ||
$newNonSeparatorTokens = [ | ||
'&sep', | ||
'/', | ||
'|', | ||
]; | ||
|
||
$promise = $this->index->updateNonSeparatorTokens($newNonSeparatorTokens); | ||
|
||
$this->index->waitForTask($promise['taskUid']); | ||
|
||
$nonSeparatorTokens = $this->index->getNonSeparatorTokens(); | ||
|
||
$this->assertEquals($newNonSeparatorTokens, $nonSeparatorTokens); | ||
} | ||
|
||
public function testResetNonSeparatorTokens(): void | ||
{ | ||
$promise = $this->index->resetNonSeparatorTokens(); | ||
|
||
$this->index->waitForTask($promise['taskUid']); | ||
$nonSeparatorTokens = $this->index->getNonSeparatorTokens(); | ||
|
||
$this->assertEquals(self::DEFAULT_NON_SEPARATOR_TOKENS, $nonSeparatorTokens); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Tests\Settings; | ||
|
||
use Meilisearch\Endpoints\Indexes; | ||
use Tests\TestCase; | ||
|
||
final class SeparatorTokensTest extends TestCase | ||
{ | ||
private Indexes $index; | ||
|
||
public const DEFAULT_SEPARATOR_TOKENS = []; | ||
|
||
protected function setUp(): void | ||
{ | ||
parent::setUp(); | ||
$this->index = $this->createEmptyIndex($this->safeIndexName()); | ||
} | ||
|
||
public function testGetDefaultSeparatorTokens(): void | ||
{ | ||
$response = $this->index->getSeparatorTokens(); | ||
|
||
$this->assertSame(self::DEFAULT_SEPARATOR_TOKENS, $response); | ||
} | ||
|
||
public function testUpdateSeparatorTokens(): void | ||
{ | ||
$newSeparatorTokens = [ | ||
'&sep', | ||
'/', | ||
'|', | ||
]; | ||
|
||
$promise = $this->index->updateSeparatorTokens($newSeparatorTokens); | ||
|
||
$this->index->waitForTask($promise['taskUid']); | ||
|
||
$separatorTokens = $this->index->getSeparatorTokens(); | ||
|
||
$this->assertSame($newSeparatorTokens, $separatorTokens); | ||
} | ||
|
||
public function testResetSeparatorTokens(): void | ||
{ | ||
$promise = $this->index->resetSeparatorTokens(); | ||
|
||
$this->index->waitForTask($promise['taskUid']); | ||
$separatorTokens = $this->index->getSeparatorTokens(); | ||
|
||
$this->assertSame(self::DEFAULT_SEPARATOR_TOKENS, $separatorTokens); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Tests\Settings; | ||
|
||
use Meilisearch\Endpoints\Indexes; | ||
use Tests\TestCase; | ||
|
||
final class WordDictionaryTest extends TestCase | ||
{ | ||
private Indexes $index; | ||
|
||
public const DEFAULT_WORD_DICTIONARY = []; | ||
|
||
protected function setUp(): void | ||
{ | ||
parent::setUp(); | ||
$this->index = $this->createEmptyIndex($this->safeIndexName()); | ||
} | ||
|
||
public function testGetDefaultWordDictionary(): void | ||
{ | ||
$response = $this->index->getDictionary(); | ||
|
||
$this->assertSame(self::DEFAULT_WORD_DICTIONARY, $response); | ||
} | ||
|
||
public function testUpdateWordDictionary(): void | ||
{ | ||
$newWordDictionary = [ | ||
'J. K.', | ||
'J. R. R.', | ||
]; | ||
|
||
$promise = $this->index->updateDictionary($newWordDictionary); | ||
|
||
$this->index->waitForTask($promise['taskUid']); | ||
|
||
$wordDictionary = $this->index->getDictionary(); | ||
|
||
$this->assertSame($newWordDictionary, $wordDictionary); | ||
} | ||
|
||
public function testResetWordDictionary(): void | ||
{ | ||
$promise = $this->index->resetDictionary(); | ||
|
||
$this->index->waitForTask($promise['taskUid']); | ||
$wordDictionary = $this->index->getDictionary(); | ||
|
||
$this->assertSame(self::DEFAULT_WORD_DICTIONARY, $wordDictionary); | ||
} | ||
} |