mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-03-13 05:45:26 +08:00
Testing: Fixed issues during pre-release testing
Some checks failed
analyse-php / build (push) Has been cancelled
lint-js / build (push) Has been cancelled
lint-php / build (push) Has been cancelled
test-js / build (push) Has been cancelled
test-migrations / build (8.2) (push) Has been cancelled
test-migrations / build (8.3) (push) Has been cancelled
test-migrations / build (8.4) (push) Has been cancelled
test-php / build (8.2) (push) Has been cancelled
test-php / build (8.3) (push) Has been cancelled
test-php / build (8.4) (push) Has been cancelled
Some checks failed
analyse-php / build (push) Has been cancelled
lint-js / build (push) Has been cancelled
lint-php / build (push) Has been cancelled
test-js / build (push) Has been cancelled
test-migrations / build (8.2) (push) Has been cancelled
test-migrations / build (8.3) (push) Has been cancelled
test-migrations / build (8.4) (push) Has been cancelled
test-php / build (8.2) (push) Has been cancelled
test-php / build (8.3) (push) Has been cancelled
test-php / build (8.4) (push) Has been cancelled
- Updated locale list - Fixed new name sorting not being case insensitive - Updated license test to account for changed deps
This commit is contained in:
parent
6211d6bcfc
commit
13dae24cbe
@ -13,12 +13,12 @@ class SortSetOperationComparisons
|
||||
{
|
||||
public static function nameAsc(Entity $a, Entity $b): int
|
||||
{
|
||||
return $a->name <=> $b->name;
|
||||
return strtolower($a->name) <=> strtolower($b->name);
|
||||
}
|
||||
|
||||
public static function nameDesc(Entity $a, Entity $b): int
|
||||
{
|
||||
return $b->name <=> $a->name;
|
||||
return strtolower($b->name) <=> strtolower($a->name);
|
||||
}
|
||||
|
||||
public static function nameNumericAsc(Entity $a, Entity $b): int
|
||||
|
@ -47,6 +47,7 @@ class LocaleManager
|
||||
'ja' => 'ja',
|
||||
'ka' => 'ka_GE',
|
||||
'ko' => 'ko_KR',
|
||||
'ku' => 'ku_TR',
|
||||
'lt' => 'lt_LT',
|
||||
'lv' => 'lv_LV',
|
||||
'nb' => 'nb_NO',
|
||||
|
@ -13,7 +13,7 @@ class LicensesTest extends TestCase
|
||||
$resp->assertSee('Licenses');
|
||||
$resp->assertSee('PHP Library Licenses');
|
||||
$resp->assertSee('Dan Brown and the BookStack project contributors');
|
||||
$resp->assertSee('doctrine/dbal');
|
||||
$resp->assertSee('league/commonmark');
|
||||
$resp->assertSee('@codemirror/lang-html');
|
||||
}
|
||||
|
||||
|
@ -187,6 +187,40 @@ class SortRuleTest extends TestCase
|
||||
$this->assertNotEquals($oldPriority, $chapter->priority);
|
||||
}
|
||||
|
||||
public function test_name_alphabetical_ordering()
|
||||
{
|
||||
$book = Book::factory()->create();
|
||||
$rule = SortRule::factory()->create(['sequence' => 'name_asc']);
|
||||
$book->sort_rule_id = $rule->id;
|
||||
$book->save();
|
||||
$this->permissions->regenerateForEntity($book);
|
||||
|
||||
$namesToAdd = [
|
||||
"Beans",
|
||||
"bread",
|
||||
"Milk",
|
||||
"pizza",
|
||||
"Tomato",
|
||||
];
|
||||
|
||||
$reverseNamesToAdd = array_reverse($namesToAdd);
|
||||
foreach ($reverseNamesToAdd as $name) {
|
||||
$this->actingAsApiEditor()->post("/api/pages", [
|
||||
'book_id' => $book->id,
|
||||
'name' => $name,
|
||||
'markdown' => 'Hello'
|
||||
]);
|
||||
}
|
||||
|
||||
foreach ($namesToAdd as $index => $name) {
|
||||
$this->assertDatabaseHas('pages', [
|
||||
'book_id' => $book->id,
|
||||
'name' => $name,
|
||||
'priority' => $index + 1,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function test_name_numeric_ordering()
|
||||
{
|
||||
$book = Book::factory()->create();
|
||||
|
Loading…
x
Reference in New Issue
Block a user