]>
BookStack Code Mirror - bookstack/commitdiff
projects
/
bookstack
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
| inline |
side by side
(parent:
6211d6b
)
Testing: Fixed issues during pre-release testing
author
Dan Brown
<redacted>
Wed, 26 Feb 2025 14:19:03 +0000
(14:19 +0000)
committer
Dan Brown
<redacted>
Wed, 26 Feb 2025 14:19:03 +0000
(14:19 +0000)
- Updated locale list
- Fixed new name sorting not being case insensitive
- Updated license test to account for changed deps
app/Sorting/SortSetOperationComparisons.php
patch
|
blob
|
history
app/Translation/LocaleManager.php
patch
|
blob
|
history
tests/Meta/LicensesTest.php
patch
|
blob
|
history
tests/Sorting/SortRuleTest.php
patch
|
blob
|
history
diff --git
a/app/Sorting/SortSetOperationComparisons.php
b/app/Sorting/SortSetOperationComparisons.php
index 0d8e582648e3f8113f682233f424631e128d8ede..e3465231573244b4784cd39fe7401943403f8cde 100644
(file)
--- a/
app/Sorting/SortSetOperationComparisons.php
+++ b/
app/Sorting/SortSetOperationComparisons.php
@@
-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
diff --git
a/app/Translation/LocaleManager.php
b/app/Translation/LocaleManager.php
index 0e2e7372ff6afaf4c5e55a46a1ba01ea0b34c4a9..86e712beec9fd2a2a7272732865bfc793983158b 100644
(file)
--- a/
app/Translation/LocaleManager.php
+++ b/
app/Translation/LocaleManager.php
@@
-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',
diff --git
a/tests/Meta/LicensesTest.php
b/tests/Meta/LicensesTest.php
index 0d6af2555cf7c048101c0355be98bc58863e03d6..a50fbdb90956557ebd6a8eaad26d7b34f5da4977 100644
(file)
--- a/
tests/Meta/LicensesTest.php
+++ b/
tests/Meta/LicensesTest.php
@@
-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');
}
diff --git
a/tests/Sorting/SortRuleTest.php
b/tests/Sorting/SortRuleTest.php
index 85b3d7991c44af7e89cd89aa21ffab0c53f4b950..e956f49df4bde7f20d1b5fa18de9952364406b43 100644
(file)
--- a/
tests/Sorting/SortRuleTest.php
+++ b/
tests/Sorting/SortRuleTest.php
@@
-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();
hide
Morty Proxy
This is a
proxified and sanitized
view of the page, visit
original site
.