aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/UtilTest.php
Commit message (Collapse)AuthorAgeFilesLines
* chore(legacy): Introduce public version ct plass and drop version methods ↵clean/version-ocpJulius Knorr2024-09-201-10/+0
| | | | | | from OC_Util Signed-off-by: Julius Knorr <jus@bitgrid.net>
* refactor: Add void return type to PHPUnit test methodsChristoph Wurst2024-09-151-21/+21
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* style: update codestyle for coding-standard 1.2.3Daniel Kesselberg2024-08-251-24/+24
| | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* fix(SetupCheck): Properly check public access to data directoryFerdinand Thiessen2024-08-081-1/+1
| | | | | | | | | | | | | When checking for public (web) access to the data directory the status is not enough as you might have a webserver that forwards to e.g. a login page. So instead check that the content of the file matches. For this the `.ncdata` file (renamed from `.ocdata`¹) has minimal text content to allow checking. ¹The file was renamed from the legacy `.ocdata`, there is a repair step to remove the old one. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
* refactor: Remove deprecated `Util` function for filename validation to ↵Ferdinand Thiessen2024-07-161-58/+0
| | | | | | `FilenameValidator` Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
* fix(Mailer): Allow to enforce strict email formatFerdinand Thiessen2024-05-311-0/+16
| | | | Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
* chore: Add SPDX headerAndy Scherzinger2024-05-131-4/+3
| | | | Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
* Make sure common and main core scripts are loaded firstJohn Molakvoæ2022-03-041-9/+30
| | | | Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
* Streamline reseting of private static propertiesLouis Chemineau2022-01-111-2/+2
| | | | Signed-off-by: Louis Chemineau <louis@chmn.me>
* Revert "Streamline reseting of private static properties"Louis Chemineau2022-01-101-2/+2
| | | | This reverts commit e50121d4c05afb8eca22bc105b160283ff4181c0.
* Streamline reseting of private static propertiesLouis Chemineau2022-01-101-2/+2
| | | | Signed-off-by: Louis Chemineau <louis@chmn.me>
* Reset $scriptDeps in testsLouis Chemineau2022-01-081-0/+2
| | | | Signed-off-by: Louis Chemineau <louis@chmn.me>
* Sort app scripts topologically by its dependenciesJonas Meurer2021-12-291-15/+27
| | | | | | | | | | | Implement a proper topological sorting algorithm. Based on the implementation by https://github.com/marcj/topsort.php Logs an error in case a circular dependency is detected. Fixes: #30278 Signed-off-by: Jonas Meurer <jonas@freesources.org>
* Improve unit testing for Util::addScript() and Util::getScript()Jonas Meurer2021-12-201-5/+53
| | | | | | | | Instead of checking for a predefined order of the scripts, test the logic: core first, dependencies before their children, no duplicates and all scripts still listed. Signed-off-by: Jonas Meurer <jonas@freesources.org>
* Adapt testsJohn Molakvoæ (skjnldsv)2021-12-021-10/+15
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* add method to shorten a string to given byte size to UtilsArthur Schiwon2021-11-261-0/+7
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* OC_Util: Add fallbacks to check if current locale is UTF8Naoto Kobayashi2021-11-161-2/+4
| | | | | | | | | Using escapeshellcmd to get current locale causes error if the function is disabled. Add fallbacks to prevent the error. Signed-off-by: Naoto Kobayashi <naoto.kobayashi4c@gmail.com>
* Add check whether escapeshellcmd behaves the same as basenameNaoto Kobayashi2021-11-151-0/+2
| | | | Signed-off-by: Naoto Kobayashi <naoto.kobayashi4c@gmail.com>
* Fix missing setlocale with php 8Naoto Kobayashi2021-11-141-0/+8
| | | | | | | | | When php version = 8, basename('§') does not bug even if LC_ALL is non-UTF-8 locale. This cause OC_Util::isSetLocaleWorking() to skip setlocale("C.UTF-8"). Fix it by using escapeshellcmd instead of basename. Signed-off-by: Naoto Kobayashi <naoto.kobayashi4c@gmail.com>
* Move UtilTest::testDefaultApps() to UrlGeneratorTestDaniel Rudolf2021-07-011-62/+0
| | | | Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
* Fix UtilTest::testDefaultApps()Daniel Rudolf2021-07-011-16/+3
| | | | | | Oh wow... This definitly was no best practice... :unamused: Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
* Add IUrlGenerator::linkToDefaultPageUrl()Daniel Rudolf2021-06-301-30/+0
| | | | | | Replaces the deprecated \OC_Util::getDefaultPageUrl() and makes this API public. Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
* load share settings from the share manager in more placesRobin Appelman2021-05-121-49/+0
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Add visibility to all methods and position of static keywordChristoph Wurst2020-04-101-9/+9
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Format control structures, classes, methods and functionChristoph Wurst2020-04-101-1/+1
| | | | | | | | | | | | | | | To continue this formatting madness, here's a tiny patch that adds unified formatting for control structures like if and loops as well as classes, their methods and anonymous functions. This basically forces the constructs to start on the same line. This is not exactly what PSR2 wants, but I think we can have a few exceptions with "our" style. The starting of braces on the same line is pracrically standard for our code. This also removes and empty lines from method/function bodies at the beginning and end. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Unify function spacing to PSR2 recommendationChristoph Wurst2020-04-091-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use the short array syntax, everywhereChristoph Wurst2020-03-261-26/+26
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use the shorter phpunit syntax for mocked return valuesChristoph Wurst2020-03-251-5/+5
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Make phpunit8 compatibleRoeland Jago Douma2019-11-271-2/+2
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Remove \OCP\Files::tmpFolderRoeland Jago Douma2018-03-191-2/+2
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Use proper method to format absolute timestampMorris Jobke2018-03-121-64/+0
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Remove deprecated \OCP\ConfigRoeland Jago Douma2018-01-131-2/+2
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Use basename() instead of self implementationMorris Jobke2017-11-231-18/+0
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Use ::class in test mocksMorris Jobke2017-10-241-2/+4
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Use IConfig instead of static OCP\ConfigMorris Jobke2017-07-271-1/+1
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Use regex to detect part filesVincent Petry2017-04-261-32/+42
|
* Add system config htaccess.IgnoreFrontController for prettyURLs w/o mod_envFelix Epp2016-11-161-0/+10
| | | | | | | Added the system config which sets all conditions to true that query the FrontControllerActive mod_env variable. Signed-off-by: Felix A. Epp <work@felixepp.de>
* Fix more testsRoeland Jago Douma2016-10-281-1/+1
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Make sure all tests use the TestCase method to overwrite servicesJoas Schilling2016-10-201-9/+2
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Fix getMock UtilTestRoeland Jago Douma2016-09-131-1/+8
|
* Some UtilTests require DBRoeland Jago Douma2016-07-111-0/+8
| | | | In the current setup there is no DI so no way to mock them.
* Remove unneeded checks if it runs on a Windows machineMorris Jobke2016-07-081-4/+2
| | | | * the setup check is still there
* Fix lib/Joas Schilling2016-05-191-0/+509