SP files are case insensitive. Lowercasing the url may save requests.

- this reduces per page requests from 9 to up to three for Rich Workspaces, which are testing for three variations of readme.md

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
Arthur Schiwon 2023-03-01 10:59:21 +01:00
Родитель c660c4e946
Коммит 145dc09175
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 7424F1874854DF23
2 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -695,7 +695,7 @@ class Storage extends Common {
* @return string
*/
private function formatPath($path) {
$path = trim($path, '/');
$path = mb_strtolower(trim($path, '/'));
$rootFolder = $this->spClient->getDocumentLibrariesRootFolder($this->documentLibrary);
$serverUrl = $rootFolder->getProperty(self::SP_PROPERTY_URL);
if ($path !== '') {

Просмотреть файл

@ -150,7 +150,7 @@ class StorageTest extends TestCase {
$serverPath = $this->documentLibraryTitle;
if (trim($path, '/') !== '') {
$serverPath .= '/' . trim($path, '/');
$serverPath .= '/' . mb_strtolower(trim($path, '/'));
}
$this->client->expects($this->any())
@ -224,7 +224,7 @@ class StorageTest extends TestCase {
$serverPath = '/' . $this->documentLibraryTitle;
if (trim($path, '/') !== '') {
$serverPath .= '/' . trim($path, '/');
$serverPath .= '/' . mb_strtolower(trim($path, '/'));
}
$this->prepareMocksForGetDocLibrary();
@ -292,7 +292,7 @@ class StorageTest extends TestCase {
*/
public function testMkDir($successful) {
$dirName = '/Parentfolder/NewDirectory';
$serverPath = '/' . $this->documentLibraryTitle . $dirName;
$serverPath = '/' . $this->documentLibraryTitle . mb_strtolower($dirName);
[, $folderMock] = $this->prepareMocksForGetDocLibrary();
@ -326,7 +326,7 @@ class StorageTest extends TestCase {
*/
public function testRmDir($successful) {
$dirName = '/Parentfolder/TargetDirectory';
$serverPath = '/' . $this->documentLibraryTitle . $dirName;
$serverPath = '/' . $this->documentLibraryTitle . mb_strtolower($dirName);
[, $folderMock] = $this->prepareMocksForGetDocLibrary();