diff options
Diffstat (limited to 'tests/lib/Template')
-rw-r--r-- | tests/lib/Template/CSSResourceLocatorTest.php | 1 | ||||
-rw-r--r-- | tests/lib/Template/JSCombinerTest.php | 9 | ||||
-rw-r--r-- | tests/lib/Template/JSResourceLocatorTest.php | 1 | ||||
-rw-r--r-- | tests/lib/Template/ResourceLocatorTest.php | 5 |
4 files changed, 11 insertions, 5 deletions
diff --git a/tests/lib/Template/CSSResourceLocatorTest.php b/tests/lib/Template/CSSResourceLocatorTest.php index ed02358a8c9..2ae37999b32 100644 --- a/tests/lib/Template/CSSResourceLocatorTest.php +++ b/tests/lib/Template/CSSResourceLocatorTest.php @@ -1,4 +1,5 @@ <?php + /** * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/tests/lib/Template/JSCombinerTest.php b/tests/lib/Template/JSCombinerTest.php index e4e6594c05c..bc286695bc7 100644 --- a/tests/lib/Template/JSCombinerTest.php +++ b/tests/lib/Template/JSCombinerTest.php @@ -1,4 +1,5 @@ <?php + /** * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later @@ -15,7 +16,9 @@ use OCP\Files\SimpleFS\ISimpleFile; use OCP\Files\SimpleFS\ISimpleFolder; use OCP\ICache; use OCP\ICacheFactory; +use OCP\ITempManager; use OCP\IURLGenerator; +use OCP\Server; use Psr\Log\LoggerInterface; class JSCombinerTest extends \Test\TestCase { @@ -471,8 +474,8 @@ var b = \'world\'; * @param $appName * @param $fileName * @param $result - * @dataProvider dataGetCachedSCSS */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataGetCachedSCSS')] public function testGetCachedSCSS($appName, $fileName, $result): void { $this->urlGenerator->expects($this->once()) ->method('linkToRoute') @@ -488,7 +491,7 @@ var b = \'world\'; public function testGetContent(): void { // Create temporary file with some content - $tmpFile = \OC::$server->getTempManager()->getTemporaryFile('JSCombinerTest'); + $tmpFile = Server::get(ITempManager::class)->getTemporaryFile('JSCombinerTest'); $pathInfo = pathinfo($tmpFile); file_put_contents($tmpFile, json_encode(['/foo/bar/test', $pathInfo['dirname'] . '/js/mytest.js'])); $tmpFilePathArray = explode('/', $pathInfo['basename']); @@ -503,7 +506,7 @@ var b = \'world\'; public function testGetContentInvalidJson(): void { // Create temporary file with some content - $tmpFile = \OC::$server->getTempManager()->getTemporaryFile('JSCombinerTest'); + $tmpFile = Server::get(ITempManager::class)->getTemporaryFile('JSCombinerTest'); $pathInfo = pathinfo($tmpFile); file_put_contents($tmpFile, 'CertainlyNotJson'); $expected = []; diff --git a/tests/lib/Template/JSResourceLocatorTest.php b/tests/lib/Template/JSResourceLocatorTest.php index bb2c2bec6c4..89ab8e66dd7 100644 --- a/tests/lib/Template/JSResourceLocatorTest.php +++ b/tests/lib/Template/JSResourceLocatorTest.php @@ -1,4 +1,5 @@ <?php + /** * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/tests/lib/Template/ResourceLocatorTest.php b/tests/lib/Template/ResourceLocatorTest.php index 65d4c7938f9..599c8391ade 100644 --- a/tests/lib/Template/ResourceLocatorTest.php +++ b/tests/lib/Template/ResourceLocatorTest.php @@ -1,4 +1,5 @@ <?php + /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -60,11 +61,11 @@ class ResourceLocatorTest extends \Test\TestCase { $locator->expects($this->once()) ->method('doFind') ->with('foo') - ->will($this->throwException(new ResourceNotFoundException('foo', 'map'))); + ->willThrowException(new ResourceNotFoundException('foo', 'map')); $locator->expects($this->once()) ->method('doFindTheme') ->with('foo') - ->will($this->throwException(new ResourceNotFoundException('foo', 'map'))); + ->willThrowException(new ResourceNotFoundException('foo', 'map')); $this->logger->expects($this->exactly(2)) ->method('debug') ->with($this->stringContains('map/foo')); |