OutputPage: Support UploadPath in testTransformResourcePath()
authorTimo Tijhof <krinklemail@gmail.com>
Fri, 10 Feb 2017 00:03:06 +0000 (00:03 +0000)
committerAaron Schulz <aschulz@wikimedia.org>
Sat, 11 Feb 2017 04:45:15 +0000 (04:45 +0000)
commitadc0e79124154dd5cd8d99a5b02b79b45e3fe16c
tree88a63967703ad1b7fdfa91d0580036855aa2d7a6
parentd03bc97cdfdfa8430269f5d4a4ac5b8ddbb5823d
OutputPage: Support UploadPath in testTransformResourcePath()

Updated tests to reflect this use case. Currently we assume all web-accessible
paths within ResourceBasePath (e.g "/w") to exist on disk at the same path
in $IP (e.g. "/var/www/mw").

While in theory any number of web server rewrites or aliases could exist,
there is one case in particular that we should support since the information
is available in the configuration: UploadDir and UploadPath. This path may
be rewritten in a way that varies by wiki in multi-wiki installs that share
the same source code. E.g. a server may rewrite "/w/images" to somewhere
else, which means it will not match the directory on disk that is shared
between wikis.

Bug: T155146
Change-Id: I320478c9c262cc012f08b585b48d290594ec2420
includes/OutputPage.php
tests/phpunit/includes/OutputPageTest.php