summaryrefslogtreecommitdiffstats
path: root/tests/lib/appframework
Commit message (Collapse)AuthorAgeFilesLines
* Check if response could get generatedLukas Reschke2015-07-021-0/+11
| | | | | | | | `json_encode` fails hard on PHP >= 5.5 if a non UTF-8 value is specified by returning false. Older PHP versions just nullify the value which makes it at least somewhat usable. This leads to very confusing errors which are very hard to debug since developers are usually not aware of this. In this case I'd consider throwing a fatal exception – since it arguably is an error situation – is a fair solution since this makes developers and administrators aware of any occurence of the problem so that these bugs can get fixed. Fixes https://github.com/owncloud/core/issues/17265
* Merge pull request #17078 from owncloud/fix-initial-server-hostMorris Jobke2015-07-011-2/+91
|\ | | | | Fix undefined offset
| * Fix undefined offsetLukas Reschke2015-06-221-2/+91
| | | | | | | | There are cases where no trusted host is specified such as when installing the instance, this lead to an undefined offset warning in the log right after installing. (when another domain than localhost or 127.0.0.1 was used)
* | AppFramework annotation whitespace unit testRobin McCorkell2015-06-211-0/+14
|/
* Add `no-store` to AppFrameworkLukas Reschke2015-06-151-1/+1
|
* Merge pull request #16714 from owncloud/fix-cors-testLukas Reschke2015-06-031-0/+7
|\ | | | | Fix #16713
| * fix #16713Bernhard Posselt2015-06-031-0/+7
| |
* | Move the helpful method to the TestCase classJoas Schilling2015-06-031-2/+2
|/
* disallow cookie auth for cors requestsBernhard Posselt2015-05-221-4/+71
| | | | | | | | | | | | | | | | testing ... fixes fix test add php doc fix small mistake add another phpdoc remove not working cors annotations from files app
* Add support for disallowing domains to the ContentSecurityPolicyLukas Reschke2015-05-201-0/+216
| | | | | | For enhanced security it is important that there is also a way to disallow domains, including the default ones. With this commit every method gets added a new "disallow" function.
* If the execute method on the mapper receives an assoc array, it binds by ↵Bernhard Posselt2015-03-192-25/+54
| | | | value instead of index
* Add support for 'child-src' directiveLukas Reschke2015-02-281-2/+17
| | | | | | This is required when working with stuff such as PDF.js in the files_pdfviewer application. Opt-in only. Master change only because the stable CSP policies has a failback that allows nearly anything :see_no_evil:
* AppFramework StreamResponseBernhard Posselt2015-02-272-13/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | First stab at the StreamResponse, see #12988 The idea is to use an interface ICallbackResponse (I'm not 100% happy with the name yet, suggestions?) that allow the response to output things in its own way, for instance stream the file using readfile Unittests are atm lacking, plan is to check if a mock of ICallbackResponse will be used by calling its callback (also unhappy with this name) method Usage is: $response = new StreamResponse('path/to/file'); rename io to output, add additional methods and handle error and not modified cases when using StreamResponse fix indention and uppercasing, also handle forbidden cases fix indention fix indention no forbidden, figuring out if a file is really readable is too complicated to get to work across OSes and streams remove useless import remove useless import fix intendation
* fix tabs and spacesBernhard Posselt2015-02-251-119/+119
|
* fix mappertestutilityBernhard Posselt2015-02-251-116/+120
|
* use IDBConnection and close cursors after insert/update/deleteBernhard Posselt2015-02-252-47/+48
|
* Get the real protocol behind several proxiesLukas Reschke2015-02-241-0/+21
| | | | | | X-Forwarded-Proto contains a list of protocols if ownCloud is behind multiple reverse proxies. This is a revival of https://github.com/owncloud/core/pull/11157 using the new IRequest public API.
* Merge pull request #13777 from owncloud/close-cursorLukas Reschke2015-02-202-16/+22
|\ | | | | Close cursor for appframework and manipulation queries if applicable
| * fix indentionBernhard Posselt2015-01-291-7/+6
| |
| * add tests for closing the cursorBernhard Posselt2015-01-292-10/+16
| |
| * ignore cursorclosingBernhard Posselt2015-01-291-8/+9
| |
* | Merge pull request #13989 from owncloud/enhancment/security/11857Clark Tomlinson2015-02-184-6/+250
|\ \ | | | | | | Allow AppFramework applications to specify a custom CSP header
| * | Rename to allowEvalLukas Reschke2015-02-161-2/+2
| | |
| * | Allow AppFramework applications to specify a custom CSP headerLukas Reschke2015-02-164-6/+250
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change allows AppFramework applications to specify a custom CSP header for example when the default policy is too strict. Furthermore this allows us to partially migrate away from CSS and allowed eval() in our JavaScript components. Legacy ownCloud components will still use the previous policy. Application developers can use this as following in their controllers: ```php $response = new TemplateResponse('activity', 'list', []); $cspHelper = new ContentSecurityPolicyHelper(); $cspHelper->addAllowedScriptDomain('www.owncloud.org'); $response->addHeader('Content-Security-Policy', $cspHelper->getPolicy()); return $response; ``` Fixes https://github.com/owncloud/core/issues/11857 which is a pre-requisite for https://github.com/owncloud/core/issues/13458 and https://github.com/owncloud/core/issues/11925
* | | Refactor OC_Request into TrustedDomainHelper and IRequestLukas Reschke2015-02-1611-45/+853
|/ / | | | | | | | | | | | | | | | | | | This changeset removes the static class `OC_Request` and moves the functions either into `IRequest` which is accessible via `\OC::$server::->getRequest()` or into a separated `TrustedDomainHelper` class for some helper methods which should not be publicly exposed. This changes only internal methods and nothing on the public API. Some public functions in `util.php` have been deprecated though in favour of the new non-static functions. Unfortunately some part of this code uses things like `__DIR__` and thus is not completely unit-testable. Where tests where possible they ahve been added though. Fixes https://github.com/owncloud/core/issues/13976 which was requested in https://github.com/owncloud/core/pull/13973#issuecomment-73492969
* | Merge pull request #13780 from owncloud/cmreflector-inheritanceLukas Reschke2015-02-121-2/+58
|\ \ | | | | | | Additional controllermethodreflector inheritance tests
| * | another test for overriding the docblockBernhard Posselt2015-01-291-0/+14
| | |
| * | additional inheritance testsBernhard Posselt2015-01-291-2/+44
| |/
* | Request requires a second parameterThomas Müller2015-02-091-6/+16
| |
* | Merge pull request #13921 from owncloud/ocs-afVincent Petry2015-02-093-1/+198
|\ \ | | | | | | Add a controller and reponse for ocs
| * | fix license emailBernhard Posselt2015-02-051-1/+1
| | |
| * | fix license emailBernhard Posselt2015-02-052-2/+2
| | |
| * | add a controller and reponse for ocsBernhard Posselt2015-02-052-0/+197
| |/
* / Respect `mod_unique_id` and refactor `OC_Request::getRequestId`Lukas Reschke2015-02-0910-96/+195
|/ | | | | | | | | | | | | | When `mod_unique_id` is enabled the ID generated by it will be used for logging. This allows for correlation of the Apache logs and the ownCloud logs. Testplan: - [ ] When `mod_unique_id` is enabled the request ID equals the one generated by `mod_unique_id`. - [ ] When `mod_unique_id` is not available the request ID is a 20 character long random string - [ ] The generated Id is stable over the lifespan of one request Changeset looks a little bit larger since I had to adjust every unit test using the HTTP\Request class for proper DI. Fixes https://github.com/owncloud/core/issues/13366
* always set url parameters when they are available in the app dispatchBernhard Posselt2015-01-151-0/+17
| | | | | | prefer url parameters passed into the main method. If they are not present, use the containers urlParameters add space
* Intelligent containerBernhard Posselt2014-12-232-0/+212
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * resolves dependencies by type hint or variable name * simpler route.php * implementation of https://github.com/owncloud/core/issues/12829 Generates and injects parameters automatically. You can now build full classes like $c->query('MyClassName') without having to register it as a service. The resolved object's instance will be saved by using registerService. If a constructor parameter is not type hinted, the parameter name will be taken. Therefore the following two implementations are identical: class Class1 { function __construct(MyClassName $class) class Class1 { function __construct($MyClassName) This makes it possible to also inject primitive values such as strings, arrays etc. In addition if the query could not be resolved, a `QueryException` is now thrown Routes can now be returned as an array from `routes.php` and an `appinfo/application.php` is optional Old commit messages: make it possible to return the routes instead of having to intialize the application try to get the controller by convention add first implementation of automatic resolve add another test just to be sure store the resolved object more tests add phpdoc to public app.php method use the same variable for the public app.php method deprecate old methods and add services for public interfaces deprecated getServer method disallow private api injection for apps other than core or settings (settings should be an app goddamnit :D) register userid because its such an often used variable fix indention and leading slash use test namespace add deprecation reasons, remove private api usage checks and remove deprecation from getServer() add additional public interfaces add public interface for rootfolder fix syntax error remove deprecation from methods where no alternative is there yet remove deprecated from method which has no alternative add timezone public service for #12881 add another deprecation hint move deprecation into separate branch remove dead comment first try to get the namespace from the info.xml, if it does not exist, just uppercase the first letter also trim the namespace name add an interface for timefactory move timefactory to public and add icontrollermethodreflector keep core interface fix copyright date in headers
* Merge pull request #12619 from owncloud/use-also-original-heaMorris Jobke2014-12-041-1/+2
|\ | | | | Merge headers
| * Fix unit testLukas Reschke2014-12-041-1/+2
| |
* | PHP < 5.4 is not supported anymore - see #12606Morris Jobke2014-12-041-8/+0
| |
* | Remove last traces of travis integrationMorris Jobke2014-12-041-2/+2
|/
* Add functions to modify cookies to response classLukas Reschke2014-11-273-9/+95
| | | | | | | | | | | | | | | | Currently there is no AppFramework way to modify cookies, which makes it unusable for quite some use-cases or results in untestable code. This PR adds some basic functionalities to add and invalidate cookies. Usage: ```php $response = new TemplateResponse(...); $response->addCookie('foo', 'bar'); $response->invalidateCookie('foo'); $response->addCookie('bar', 'foo', new \DateTime('2015-01-01 00:00')); ``` Existing cookies can be accessed with the AppFramework using `$this->request->getCookie($name)`.
* Merge pull request #12294 from owncloud/route-postfixThomas Müller2014-11-241-1/+14
|\ | | | | Add route postfix to allow url versioning when only the http method changed
| * add postfixBernhard Posselt2014-11-191-1/+14
| | | | | | | | add postfix
* | Make remaining files extend the test baseJoas Schilling2014-11-1923-31/+56
|/
* Check if app is enabled for userLukas Reschke2014-11-151-2/+2
| | | | Fixes https://github.com/owncloud/core/issues/12188 for AppFramework apps
* fix typo in content typeBernhard Posselt2014-11-051-1/+1
|
* remove unnecessary require calls - the ownCloud class loader is supposed to ↵Thomas Müller2014-10-304-14/+12
| | | | take care of this
* add dataresponseBernhard Posselt2014-10-294-24/+185
| | | | | | | | | | | | | | fix docstrings adjust copyright date another copyright date update another header update implement third headers argument, fix indention, fix docstrings fix docstrings
* introduce SessionMiddleWare to control session handling via an annotationThomas Müller2014-10-221-0/+89
|
* Allow default values for route parameters.Patrick Paysant2014-09-091-4/+22
|