[TASK] replaced @expectedException in sysext:extensionmanager 87/48487/2
authorNadir Sunar <dernadir@gmail.com>
Tue, 7 Jun 2016 16:15:11 +0000 (18:15 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Tue, 7 Jun 2016 16:59:06 +0000 (18:59 +0200)
Resolves: #76504
Releases: master
Change-Id: Id57369db6eb398db0b391ea23f325ee219d76424
Reviewed-on: https://review.typo3.org/48487
Reviewed-by: Jan Helke <typo3@helke.de>
Tested-by: Jan Helke <typo3@helke.de>
Reviewed-by: Gordon Br├╝ggemann <gordon.brueggemann@gmx.de>
Tested-by: Gordon Br├╝ggemann <gordon.brueggemann@gmx.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/extensionmanager/Tests/Unit/Domain/Model/DownloadQueueTest.php
typo3/sysext/extensionmanager/Tests/Unit/Utility/FileHandlingUtilityTest.php

index dc67b94..2a51590 100644 (file)
@@ -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);
     }
index b4c33bb..303f524 100644 (file)
@@ -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);