Skip to content
Snippets Groups Projects
Commit f2ad5407 authored by Nadir Sunar's avatar Nadir Sunar Committed by Wouter Wolters
Browse files

[TASK] replaced @expectedException in sysext:extensionmanager

Resolves: #76504
Releases: master
Change-Id: Id57369db6eb398db0b391ea23f325ee219d76424
Reviewed-on: https://review.typo3.org/48487


Reviewed-by: default avatarJan Helke <typo3@helke.de>
Tested-by: default avatarJan Helke <typo3@helke.de>
Reviewed-by: default avatarGordon Brüggemann <gordon.brueggemann@gmx.de>
Tested-by: default avatarGordon Brüggemann <gordon.brueggemann@gmx.de>
Reviewed-by: default avatarWouter Wolters <typo3@wouterwolters.nl>
Tested-by: default avatarWouter Wolters <typo3@wouterwolters.nl>
parent f6f03a80
Branches
Tags
No related merge requests found
......@@ -13,6 +13,7 @@ namespace TYPO3\CMS\Extensionmanager\Tests\Unit\Domain\Model;
*
* The TYPO3 project - inspiring people to share!
*/
use TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException;
/**
* Download queue test
......@@ -67,19 +68,17 @@ class DownloadQueueTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
/**
* @test
* @expectedException \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException
* @expectedExceptionCode 1342432103
*/
public function addExtensionToQueueThrowsExceptionIfUnknownStackIsGiven()
{
$this->expectException(ExtensionManagerException::class);
$this->expectExceptionCode(1342432103);
$this->downloadQueueMock->addExtensionToQueue($this->extensionMock, 'unknownStack');
}
/**
* @test
* @return void
* @expectedException \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException
* @expectedExceptionCode 1342432101
*/
public function addExtensionToQueueThrowsExceptionIfExtensionWithSameKeyAndDifferentValuesAlreadyExists()
{
......@@ -88,6 +87,8 @@ class DownloadQueueTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
$extensionMock2->setExtensionKey('foobar');
$extensionMock2->setVersion('1.0.3');
$this->expectException(ExtensionManagerException::class);
$this->expectExceptionCode(1342432101);
$this->downloadQueueMock->addExtensionToQueue($extensionMock2);
$this->downloadQueueMock->addExtensionToQueue($this->extensionMock);
}
......
......@@ -13,6 +13,7 @@ namespace TYPO3\CMS\Extensionmanager\Tests\Unit\Utility;
*
* The TYPO3 project - inspiring people to share!
*/
use TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException;
/**
* Testcase
......@@ -83,10 +84,11 @@ class FileHandlingUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
* @param string $invalidRelativePath
* @test
* @dataProvider invalidRelativePathDataProvider
* @expectedException \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException
*/
public function getAbsolutePathThrowsExceptionForInvalidRelativePaths($invalidRelativePath)
{
$this->expectException(ExtensionManagerException::class);
$this->expectExceptionCode(1350742864);
$fileHandlerMock = $this->getAccessibleMock(\TYPO3\CMS\Extensionmanager\Utility\FileHandlingUtility::class, array('dummy'), array());
$fileHandlerMock->_call('getAbsolutePath', $invalidRelativePath);
}
......@@ -133,11 +135,12 @@ class FileHandlingUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
/**
* @test
* @expectedException \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException
* @return void
*/
public function makeAndClearExtensionDirThrowsExceptionOnInvalidPath()
{
$this->expectException(ExtensionManagerException::class);
$this->expectExceptionCode(1337280417);
$fileHandlerMock = $this->getAccessibleMock(\TYPO3\CMS\Extensionmanager\Utility\FileHandlingUtility::class, array('removeDirectory', 'addDirectory'));
$languageServiceMock = $this->getMock(\TYPO3\CMS\Lang\LanguageService::class);
$fileHandlerMock->_set('languageService', $languageServiceMock);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment