summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-04-20 16:55:36 +0200
committerLukas Reschke <lukas@owncloud.com>2015-04-20 16:55:36 +0200
commitfe2cbc37951ea25e3d545d78289c64542ef58eca (patch)
treeb8d1a6f1e3ee9319b1df201c1d7ed29099755a11 /tests
parent3e8f6cdba95690a12de4f8d6b99c59f7a823fbb0 (diff)
parentddcd79132db5b4251bff10c2dba241460fdc8f68 (diff)
downloadnextcloud-server-fe2cbc37951ea25e3d545d78289c64542ef58eca.tar.gz
nextcloud-server-fe2cbc37951ea25e3d545d78289c64542ef58eca.zip
Merge pull request #15744 from owncloud/fix-inverted-path-in-resourcenotfound
Fix wrong path generation
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/template/resourcelocator.php28
1 files changed, 20 insertions, 8 deletions
diff --git a/tests/lib/template/resourcelocator.php b/tests/lib/template/resourcelocator.php
index b0851621fd2..ef5e2ed1357 100644
--- a/tests/lib/template/resourcelocator.php
+++ b/tests/lib/template/resourcelocator.php
@@ -6,8 +6,12 @@
* See the COPYING-README file.
*/
-class Test_ResourceLocator extends \Test\TestCase {
- /** @var PHPUnit_Framework_MockObject_MockObject */
+namespace Test\Template;
+
+use OC\Template\ResourceNotFoundException;
+
+class ResourceLocator extends \Test\TestCase {
+ /** @var \PHPUnit_Framework_MockObject_MockObject */
protected $logger;
protected function setUp() {
@@ -17,10 +21,14 @@ class Test_ResourceLocator extends \Test\TestCase {
/**
* @param string $theme
+ * @param array $core_map
+ * @param array $party_map
+ * @param array $appsRoots
+ * @return \PHPUnit_Framework_MockObject_MockObject
*/
- public function getResourceLocator( $theme, $core_map, $party_map, $appsroots ) {
+ public function getResourceLocator($theme, $core_map, $party_map, $appsRoots) {
return $this->getMockForAbstractClass('OC\Template\ResourceLocator',
- array($this->logger, $theme, $core_map, $party_map, $appsroots ),
+ array($this->logger, $theme, $core_map, $party_map, $appsRoots ),
'', true, true, true, array());
}
@@ -44,6 +52,7 @@ class Test_ResourceLocator extends \Test\TestCase {
$locator->expects($this->once())
->method('doFindTheme')
->with('foo');
+ /** @var \OC\Template\ResourceLocator $locator */
$locator->find(array('foo'));
}
@@ -53,20 +62,23 @@ class Test_ResourceLocator extends \Test\TestCase {
$locator->expects($this->once())
->method('doFind')
->with('foo')
- ->will($this->throwException(new \OC\Template\ResourceNotFoundException('foo', 'map')));
+ ->will($this->throwException(new ResourceNotFoundException('foo', 'map')));
$locator->expects($this->once())
->method('doFindTheme')
->with('foo')
- ->will($this->throwException(new \OC\Template\ResourceNotFoundException('foo', 'map')));
+ ->will($this->throwException(new ResourceNotFoundException('foo', 'map')));
$this->logger->expects($this->exactly(2))
- ->method('error');
+ ->method('error')
+ ->with($this->stringContains('map/foo'));
+ /** @var \OC\Template\ResourceLocator $locator */
$locator->find(array('foo'));
}
public function testAppendIfExist() {
$locator = $this->getResourceLocator('theme',
array(__DIR__=>'map'), array('3rd'=>'party'), array('foo'=>'bar'));
- $method = new ReflectionMethod($locator, 'appendIfExist');
+ /** @var \OC\Template\ResourceLocator $locator */
+ $method = new \ReflectionMethod($locator, 'appendIfExist');
$method->setAccessible(true);
$method->invoke($locator, __DIR__, basename(__FILE__), 'webroot');