[TASK] Replace @expectedException annotation in sysext:install 05/48505/3
authorNadir Sunar <dernadir@gmail.com>
Wed, 8 Jun 2016 12:22:08 +0000 (14:22 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Wed, 8 Jun 2016 12:37:45 +0000 (14:37 +0200)
Use expectException() instead of @expectedException in unit tests
and add expectedExceptionCode() where possible.
This patch handles occurences in sysext:install.

Resolves: #76499
Releases: master
Change-Id: I4bb6f33c958484e769ab06ea7ab889aba3d44b61
Reviewed-on: https://review.typo3.org/48505
Reviewed-by: Jan Helke <typo3@helke.de>
Tested-by: Jan Helke <typo3@helke.de>
Reviewed-by: Susanne Moog <typo3@susannemoog.de>
Tested-by: Susanne Moog <typo3@susannemoog.de>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/install/Tests/Unit/FolderStructure/AbstractNodeTest.php
typo3/sysext/install/Tests/Unit/FolderStructure/DirectoryNodeTest.php
typo3/sysext/install/Tests/Unit/FolderStructure/FileNodeTest.php
typo3/sysext/install/Tests/Unit/FolderStructure/LinkNodeTest.php
typo3/sysext/install/Tests/Unit/FolderStructure/RootNodeTest.php
typo3/sysext/install/Tests/Unit/Service/CoreVersionServiceTest.php
typo3/sysext/install/Tests/Unit/Status/StatusUtilityTest.php
typo3/sysext/install/Tests/Unit/View/JsonViewTest.php

index 23eb858..0a0bedb 100644 (file)
@@ -13,6 +13,8 @@ namespace TYPO3\CMS\Install\Tests\Unit\FolderStructure;
  *
  * The TYPO3 project - inspiring people to share!
  */
+use TYPO3\CMS\Install\FolderStructure\Exception;
+use TYPO3\CMS\Install\FolderStructure\Exception\InvalidArgumentException;
 
 /**
  * Test case
@@ -153,7 +155,6 @@ class AbstractNodeTest extends \TYPO3\CMS\Install\Tests\Unit\FolderStructureTest
 
     /**
      * @test
-     * @expectedException \TYPO3\CMS\Install\FolderStructure\Exception
      */
     public function fixPermissionThrowsExceptionIfPermissionAreAlreadyCorrect()
     {
@@ -165,6 +166,8 @@ class AbstractNodeTest extends \TYPO3\CMS\Install\Tests\Unit\FolderStructureTest
             '',
             false
         );
+        $this->expectException(Exception::class);
+        $this->expectExceptionCode(1366744035);
         $node->expects($this->any())->method('getAbsolutePath')->will($this->returnValue(''));
         $node->expects($this->once())->method('isPermissionCorrect')->will($this->returnValue(true));
         $node->_call('fixPermission');
@@ -307,10 +310,11 @@ class AbstractNodeTest extends \TYPO3\CMS\Install\Tests\Unit\FolderStructureTest
 
     /**
      * @test
-     * @expectedException \TYPO3\CMS\Install\FolderStructure\Exception\InvalidArgumentException
      */
     public function getRelativePathBelowSiteRootThrowsExceptionIfGivenPathIsNotBelowPathSiteConstant()
     {
+        $this->expectException(InvalidArgumentException::class);
+        $this->expectExceptionCode(1366398198);
         /** @var $node \TYPO3\CMS\Install\FolderStructure\AbstractNode|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
         $node = $this->getAccessibleMock(\TYPO3\CMS\Install\FolderStructure\AbstractNode::class, array('dummy'), array(), '', false);
         $node->_call('getRelativePathBelowSiteRoot', '/tmp');
index f7f3bd6..df30b20 100644 (file)
@@ -13,7 +13,8 @@ namespace TYPO3\CMS\Install\Tests\Unit\FolderStructure;
  *
  * The TYPO3 project - inspiring people to share!
  */
-
+use TYPO3\CMS\Install\FolderStructure\Exception;
+use TYPO3\CMS\Install\FolderStructure\Exception\InvalidArgumentException;
 /**
  * Test case
  */
@@ -21,10 +22,11 @@ class DirectoryNodeTest extends \TYPO3\CMS\Install\Tests\Unit\FolderStructureTes
 {
     /**
      * @test
-     * @expectedException \TYPO3\CMS\Install\FolderStructure\Exception\InvalidArgumentException
      */
     public function constructorThrowsExceptionIfParentIsNull()
     {
+        $this->expectException(InvalidArgumentException::class);
+        $this->expectExceptionCode(1366222203);
         /** @var $node \TYPO3\CMS\Install\FolderStructure\DirectoryNode|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
         $node = $this->getAccessibleMock(\TYPO3\CMS\Install\FolderStructure\DirectoryNode::class, array('dummy'), array(), '', false);
         $node->__construct(array(), null);
@@ -32,10 +34,11 @@ class DirectoryNodeTest extends \TYPO3\CMS\Install\Tests\Unit\FolderStructureTes
 
     /**
      * @test
-     * @expectedException \TYPO3\CMS\Install\FolderStructure\Exception\InvalidArgumentException
      */
     public function constructorThrowsExceptionIfNameContainsForwardSlash()
     {
+        $this->expectException(InvalidArgumentException::class);
+        $this->expectExceptionCode(1366226639);
         $parent = $this->getMock(\TYPO3\CMS\Install\FolderStructure\NodeInterface::class, array(), array(), '', false);
         /** @var $node \TYPO3\CMS\Install\FolderStructure\DirectoryNode|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
         $node = $this->getAccessibleMock(\TYPO3\CMS\Install\FolderStructure\DirectoryNode::class, array('dummy'), array(), '', false);
@@ -429,10 +432,11 @@ class DirectoryNodeTest extends \TYPO3\CMS\Install\Tests\Unit\FolderStructureTes
 
     /**
      * @test
-     * @expectedException \TYPO3\CMS\Install\FolderStructure\Exception
      */
     public function createDirectoryThrowsExceptionIfNodeExists()
     {
+        $this->expectException(Exception::class);
+        $this->expectExceptionCode(1366740091);
         /** @var $node \TYPO3\CMS\Install\FolderStructure\DirectoryNode|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
         $node = $this->getAccessibleMock(\TYPO3\CMS\Install\FolderStructure\DirectoryNode::class, array('exists', 'getAbsolutePath'), array(), '', false);
         $node->expects($this->once())->method('getAbsolutePath')->will($this->returnValue(''));
@@ -487,10 +491,11 @@ class DirectoryNodeTest extends \TYPO3\CMS\Install\Tests\Unit\FolderStructureTes
 
     /**
      * @test
-     * @expectedException \TYPO3\CMS\Install\FolderStructure\Exception\InvalidArgumentException
      */
     public function createChildrenThrowsExceptionIfAChildTypeIsNotSet()
     {
+        $this->expectException(InvalidArgumentException::class);
+        $this->expectExceptionCode(1366222204);
         /** @var $node \TYPO3\CMS\Install\FolderStructure\DirectoryNode|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
         $node = $this->getAccessibleMock(\TYPO3\CMS\Install\FolderStructure\DirectoryNode::class, array('dummy'), array(), '', false);
         $brokenStructure = array(
@@ -503,10 +508,11 @@ class DirectoryNodeTest extends \TYPO3\CMS\Install\Tests\Unit\FolderStructureTes
 
     /**
      * @test
-     * @expectedException \TYPO3\CMS\Install\FolderStructure\Exception\InvalidArgumentException
      */
     public function createChildrenThrowsExceptionIfAChildNameIsNotSet()
     {
+        $this->expectException(InvalidArgumentException::class);
+        $this->expectExceptionCode(1366222205);
         /** @var $node \TYPO3\CMS\Install\FolderStructure\DirectoryNode|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
         $node = $this->getAccessibleMock(\TYPO3\CMS\Install\FolderStructure\DirectoryNode::class, array('dummy'), array(), '', false);
         $brokenStructure = array(
@@ -519,10 +525,11 @@ class DirectoryNodeTest extends \TYPO3\CMS\Install\Tests\Unit\FolderStructureTes
 
     /**
      * @test
-     * @expectedException \TYPO3\CMS\Install\FolderStructure\Exception\InvalidArgumentException
      */
     public function createChildrenThrowsExceptionForMultipleChildrenWithSameName()
     {
+        $this->expectException(InvalidArgumentException::class);
+        $this->expectExceptionCode(1366222206);
         /** @var $node \TYPO3\CMS\Install\FolderStructure\DirectoryNode|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
         $node = $this->getAccessibleMock(\TYPO3\CMS\Install\FolderStructure\DirectoryNode::class, array('dummy'), array(), '', false);
         $brokenStructure = array(
index ebdbbd3..92f6f80 100644 (file)
@@ -13,7 +13,8 @@ namespace TYPO3\CMS\Install\Tests\Unit\FolderStructure;
  *
  * The TYPO3 project - inspiring people to share!
  */
-
+use TYPO3\CMS\Install\FolderStructure\Exception;
+use TYPO3\CMS\Install\FolderStructure\Exception\InvalidArgumentException;
 /**
  * Test case
  */
@@ -21,10 +22,11 @@ class FileNodeTest extends \TYPO3\CMS\Install\Tests\Unit\FolderStructureTestCase
 {
     /**
      * @test
-     * @expectedException \TYPO3\CMS\Install\FolderStructure\Exception\InvalidArgumentException
      */
     public function constructorThrowsExceptionIfParentIsNull()
     {
+        $this->expectException(InvalidArgumentException::class);
+        $this->expectExceptionCode(1366927513);
         /** @var $node \TYPO3\CMS\Install\FolderStructure\FileNode|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
         $node = $this->getAccessibleMock(\TYPO3\CMS\Install\FolderStructure\FileNode::class, array('dummy'), array(), '', false);
         $node->__construct(array(), null);
@@ -32,10 +34,11 @@ class FileNodeTest extends \TYPO3\CMS\Install\Tests\Unit\FolderStructureTestCase
 
     /**
      * @test
-     * @expectedException \TYPO3\CMS\Install\FolderStructure\Exception\InvalidArgumentException
      */
     public function constructorThrowsExceptionIfNameContainsForwardSlash()
     {
+        $this->expectException(InvalidArgumentException::class);
+        $this->expectExceptionCode(1366222207);
         $parent = $this->getMock(\TYPO3\CMS\Install\FolderStructure\NodeInterface::class, array(), array(), '', false);
         /** @var $node \TYPO3\CMS\Install\FolderStructure\FileNode|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
         $node = $this->getAccessibleMock(\TYPO3\CMS\Install\FolderStructure\FileNode::class, array('dummy'), array(), '', false);
@@ -92,10 +95,11 @@ class FileNodeTest extends \TYPO3\CMS\Install\Tests\Unit\FolderStructureTestCase
 
     /**
      * @test
-     * @expectedException \TYPO3\CMS\Install\FolderStructure\Exception\InvalidArgumentException
      */
     public function constructorThrowsExceptionIfBothTargetContentAndTargetContentFileAreSet()
     {
+        $this->expectException(InvalidArgumentException::class);
+        $this->expectExceptionCode(1380364361);
         /** @var $node \TYPO3\CMS\Install\FolderStructure\FileNode|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
         $node = $this->getAccessibleMock(\TYPO3\CMS\Install\FolderStructure\FileNode::class, array('dummy'), array(), '', false);
         $parent = $this->getMock(\TYPO3\CMS\Install\FolderStructure\RootNodeInterface::class, array(), array(), '', false);
@@ -145,10 +149,11 @@ class FileNodeTest extends \TYPO3\CMS\Install\Tests\Unit\FolderStructureTestCase
 
     /**
      * @test
-     * @expectedException \TYPO3\CMS\Install\FolderStructure\Exception\InvalidArgumentException
      */
     public function constructorThrowsExceptionIfTargetContentFileDoesNotExist()
     {
+        $this->expectException(InvalidArgumentException::class);
+        $this->expectExceptionCode(1380364362);
         /** @var $node \TYPO3\CMS\Install\FolderStructure\FileNode|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
         $node = $this->getAccessibleMock(\TYPO3\CMS\Install\FolderStructure\FileNode::class, array('dummy'), array(), '', false);
         $parent = $this->getMock(\TYPO3\CMS\Install\FolderStructure\RootNodeInterface::class, array(), array(), '', false);
@@ -539,10 +544,11 @@ class FileNodeTest extends \TYPO3\CMS\Install\Tests\Unit\FolderStructureTestCase
 
     /**
      * @test
-     * @expectedException \TYPO3\CMS\Install\FolderStructure\Exception
      */
     public function createFileThrowsExceptionIfNodeExists()
     {
+        $this->expectException(Exception::class);
+        $this->expectExceptionCode(1366398198);
         /** @var $node \TYPO3\CMS\Install\FolderStructure\FileNode|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
         $node = $this->getAccessibleMock(\TYPO3\CMS\Install\FolderStructure\FileNode::class, array('exists', 'getAbsolutePath'), array(), '', false);
         $node->expects($this->once())->method('getAbsolutePath')->will($this->returnValue(''));
@@ -597,10 +603,11 @@ class FileNodeTest extends \TYPO3\CMS\Install\Tests\Unit\FolderStructureTestCase
 
     /**
      * @test
-     * @expectedException \TYPO3\CMS\Install\FolderStructure\Exception
      */
     public function isContentCorrectThrowsExceptionIfTargetIsNotAFile()
     {
+        $this->expectException(Exception::class);
+        $this->expectExceptionCode(1367056363);
         /** @var $node \TYPO3\CMS\Install\FolderStructure\FileNode|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
         $node = $this->getAccessibleMock(\TYPO3\CMS\Install\FolderStructure\FileNode::class, array('getAbsolutePath'), array(), '', false);
         $path = $this->getVirtualTestDir('dir_');
@@ -674,10 +681,11 @@ class FileNodeTest extends \TYPO3\CMS\Install\Tests\Unit\FolderStructureTestCase
 
     /**
      * @test
-     * @expectedException \TYPO3\CMS\Install\FolderStructure\Exception
      */
     public function setContentThrowsExceptionIfTargetIsNotAFile()
     {
+        $this->expectException(Exception::class);
+        $this->expectExceptionCode(1367060201);
         /** @var $node \TYPO3\CMS\Install\FolderStructure\FileNode|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
         $node = $this->getAccessibleMock(\TYPO3\CMS\Install\FolderStructure\FileNode::class, array('getAbsolutePath'), array(), '', false);
         $path = $this->getVirtualTestDir('dir_');
@@ -688,10 +696,11 @@ class FileNodeTest extends \TYPO3\CMS\Install\Tests\Unit\FolderStructureTestCase
 
     /**
      * @test
-     * @expectedException \TYPO3\CMS\Install\FolderStructure\Exception
      */
     public function setContentThrowsExceptionIfTargetContentIsNull()
     {
+        $this->expectException(Exception::class);
+        $this->expectExceptionCode(1367060202);
         /** @var $node \TYPO3\CMS\Install\FolderStructure\FileNode|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
         $node = $this->getAccessibleMock(\TYPO3\CMS\Install\FolderStructure\FileNode::class, array('getAbsolutePath'), array(), '', false);
         $path = $this->getVirtualTestFilePath('file_');
index 7be84db..abfba7b 100644 (file)
@@ -13,7 +13,7 @@ namespace TYPO3\CMS\Install\Tests\Unit\FolderStructure;
  *
  * The TYPO3 project - inspiring people to share!
  */
-
+use TYPO3\CMS\Install\FolderStructure\Exception\InvalidArgumentException;
 /**
  * Test case
  */
@@ -21,10 +21,11 @@ class LinkNodeTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
 {
     /**
      * @test
-     * @expectedException \TYPO3\CMS\Install\FolderStructure\Exception\InvalidArgumentException
      */
     public function constructorThrowsExceptionIfParentIsNull()
     {
+        $this->expectException(InvalidArgumentException::class);
+        $this->expectExceptionCode(1380485700);
         /** @var $node \TYPO3\CMS\Install\FolderStructure\LinkNode|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
         $node = $this->getAccessibleMock(\TYPO3\CMS\Install\FolderStructure\LinkNode::class, array('dummy'), array(), '', false);
         $node->__construct(array(), null);
@@ -32,10 +33,11 @@ class LinkNodeTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
 
     /**
      * @test
-     * @expectedException \TYPO3\CMS\Install\FolderStructure\Exception\InvalidArgumentException
      */
     public function constructorThrowsExceptionIfNameContainsForwardSlash()
     {
+        $this->expectException(InvalidArgumentException::class);
+        $this->expectExceptionCode(1380546061);
         $parent = $this->getMock(\TYPO3\CMS\Install\FolderStructure\NodeInterface::class, array(), array(), '', false);
         /** @var $node \TYPO3\CMS\Install\FolderStructure\LinkNode|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
         $node = $this->getAccessibleMock(\TYPO3\CMS\Install\FolderStructure\LinkNode::class, array('dummy'), array(), '', false);
@@ -237,10 +239,11 @@ class LinkNodeTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
 
     /**
      * @test
-     * @expectedException \TYPO3\CMS\Install\FolderStructure\Exception\InvalidArgumentException
      */
     public function isLinkThrowsExceptionIfLinkNotExists()
     {
+        $this->expectException(InvalidArgumentException::class);
+        $this->expectExceptionCode(1380556246);
         /** @var $node \TYPO3\CMS\Install\FolderStructure\LinkNode|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
         $node = $this->getAccessibleMock(\TYPO3\CMS\Install\FolderStructure\LinkNode::class, array('exists'), array(), '', false);
         $node->expects($this->once())->method('exists')->will($this->returnValue(false));
@@ -282,10 +285,11 @@ class LinkNodeTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
 
     /**
      * @test
-     * @expectedException \TYPO3\CMS\Install\FolderStructure\Exception\InvalidArgumentException
      */
     public function isTargetCorrectThrowsExceptionIfLinkNotExists()
     {
+        $this->expectException(InvalidArgumentException::class);
+        $this->expectExceptionCode(1380556245);
         /** @var $node \TYPO3\CMS\Install\FolderStructure\LinkNode|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
         $node = $this->getAccessibleMock(\TYPO3\CMS\Install\FolderStructure\LinkNode::class, array('exists'), array(), '', false);
         $node->expects($this->once())->method('exists')->will($this->returnValue(false));
@@ -294,10 +298,11 @@ class LinkNodeTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
 
     /**
      * @test
-     * @expectedException \TYPO3\CMS\Install\FolderStructure\Exception\InvalidArgumentException
      */
     public function isTargetCorrectThrowsExceptionIfNodeIsNotALink()
     {
+        $this->expectException(InvalidArgumentException::class);
+        $this->expectExceptionCode(1380556247);
         /** @var $node \TYPO3\CMS\Install\FolderStructure\LinkNode|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
         $node = $this->getAccessibleMock(\TYPO3\CMS\Install\FolderStructure\LinkNode::class, array('exists', 'isLink', 'getTarget'), array(), '', false);
         $node->expects($this->any())->method('exists')->will($this->returnValue(true));
index c1eac73..8f9ae6f 100644 (file)
@@ -13,6 +13,8 @@ namespace TYPO3\CMS\Install\Tests\Unit\FolderStructure;
  *
  * The TYPO3 project - inspiring people to share!
  */
+use TYPO3\CMS\Install\FolderStructure\Exception\InvalidArgumentException;
+use TYPO3\CMS\Install\FolderStructure\Exception\RootNodeException;
 
 /**
  * Test case
@@ -21,10 +23,11 @@ class RootNodeTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
 {
     /**
      * @test
-     * @expectedException \TYPO3\CMS\Install\FolderStructure\Exception\RootNodeException
      */
     public function constructorThrowsExceptionIfParentIsNotNull()
     {
+        $this->expectException(RootNodeException::class);
+        $this->expectExceptionCode(1366140117);
         /** @var $node \TYPO3\CMS\Install\FolderStructure\RootNode|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
         $node = $this->getAccessibleMock(\TYPO3\CMS\Install\FolderStructure\RootNode::class, array('isWindowsOs'), array(), '', false);
         $falseParent = $this->getMock(
@@ -39,10 +42,11 @@ class RootNodeTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
 
     /**
      * @test
-     * @expectedException \TYPO3\CMS\Install\FolderStructure\Exception\InvalidArgumentException
      */
     public function constructorThrowsExceptionIfAbsolutePathIsNotSet()
     {
+        $this->expectException(InvalidArgumentException::class);
+        $this->expectExceptionCode(1366141329);
         /** @var $node \TYPO3\CMS\Install\FolderStructure\RootNode|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
         $node = $this->getAccessibleMock(\TYPO3\CMS\Install\FolderStructure\RootNode::class, array('isWindowsOs'), array(), '', false);
         $structure = array(
@@ -53,10 +57,11 @@ class RootNodeTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
 
     /**
      * @test
-     * @expectedException \TYPO3\CMS\Install\FolderStructure\Exception\InvalidArgumentException
      */
     public function constructorThrowsExceptionIfAbsolutePathIsNotAbsoluteOnWindows()
     {
+        $this->expectException(InvalidArgumentException::class);
+        $this->expectExceptionCode(1366141329);
         /** @var $node \TYPO3\CMS\Install\FolderStructure\RootNode|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
         $node = $this->getAccessibleMock(\TYPO3\CMS\Install\FolderStructure\RootNode::class, array('isWindowsOs'), array(), '', false);
         $node
@@ -71,10 +76,11 @@ class RootNodeTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
 
     /**
      * @test
-     * @expectedException \TYPO3\CMS\Install\FolderStructure\Exception\InvalidArgumentException
      */
     public function constructorThrowsExceptionIfAbsolutePathIsNotAbsoluteOnUnix()
     {
+        $this->expectException(InvalidArgumentException::class);
+        $this->expectExceptionCode(1366141329);
         /** @var $node \TYPO3\CMS\Install\FolderStructure\RootNode|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
         $node = $this->getAccessibleMock(\TYPO3\CMS\Install\FolderStructure\RootNode::class, array('isWindowsOs'), array(), '', false);
         $node
index 38d7568..9e962b2 100644 (file)
@@ -16,6 +16,7 @@ namespace TYPO3\CMS\Install\Service;
 
 use TYPO3\CMS\Core\Registry;
 use TYPO3\CMS\Core\Tests\UnitTestCase;
+use TYPO3\CMS\Install\Service\Exception\CoreVersionServiceException;
 
 /**
  * Test case
@@ -82,10 +83,11 @@ class CoreVersionServiceTest extends UnitTestCase
 
     /**
      * @test
-     * @expectedException \TYPO3\CMS\Install\Service\Exception\CoreVersionServiceException
      */
     public function getTarGzSha1OfVersionThrowsExceptionIfSha1DoesNotExistInMatrix()
     {
+        $this->expectException(CoreVersionServiceException::class);
+        $this->expectExceptionCode(1381263173);
         /** @var $instance CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
         $instance = $this->getAccessibleMock(
             CoreVersionService::class,
@@ -377,10 +379,11 @@ class CoreVersionServiceTest extends UnitTestCase
 
     /**
      * @test
-     * @expectedException \TYPO3\CMS\Install\Service\Exception\CoreVersionServiceException
      */
     public function getVersionMatrixThrowsExceptionIfVersionMatrixIsNotYetSetInRegistry()
     {
+        $this->expectException(CoreVersionServiceException::class);
+        $this->expectExceptionCode(1380898792);
         /** @var $instance CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
         $instance = $this->getAccessibleMock(CoreVersionService::class, array('fetchVersionMatrixFromRemote'), array(), '', false);
         $registry = $this->getMock(Registry::class);
@@ -405,10 +408,11 @@ class CoreVersionServiceTest extends UnitTestCase
 
     /**
      * @test
-     * @expectedException \TYPO3\CMS\Install\Service\Exception\CoreVersionServiceException
      */
     public function getReleaseTimestampOfVersionThrowsExceptionIfReleaseDateIsNotDefined()
     {
+        $this->expectException(CoreVersionServiceException::class);
+        $this->expectExceptionCode(1380905853);
         $versionMatrix = array(
             '7' => array(
                 'releases' => array(
@@ -450,10 +454,11 @@ class CoreVersionServiceTest extends UnitTestCase
 
     /**
      * @test
-     * @expectedException \TYPO3\CMS\Install\Service\Exception\CoreVersionServiceException
      */
     public function ensureVersionExistsInMatrixThrowsExceptionIfMinorVersionDoesNotExist()
     {
+        $this->expectException(CoreVersionServiceException::class);
+        $this->expectExceptionCode(1380905851);
         $versionMatrixFixtureFile = __DIR__ . '/Fixtures/VersionMatrixFixture.php';
         /** @var $instance CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
         $instance = $this->getAccessibleMock(
@@ -470,10 +475,11 @@ class CoreVersionServiceTest extends UnitTestCase
 
     /**
      * @test
-     * @expectedException \TYPO3\CMS\Install\Service\Exception\CoreVersionServiceException
      */
     public function ensureVersionExistsInMatrixThrowsExceptionIfPatchLevelDoesNotExist()
     {
+        $this->expectException(CoreVersionServiceException::class);
+        $this->expectExceptionCode(1380905852);
         $versionMatrixFixtureFile = __DIR__ . '/Fixtures/VersionMatrixFixture.php';
         /** @var $instance CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
         $instance = $this->getAccessibleMock(
index 264c64f..4898dc2 100644 (file)
@@ -15,6 +15,7 @@ namespace TYPO3\CMS\Install\Tests\Unit\Status;
  */
 
 use TYPO3\CMS\Install\Status\StatusUtility;
+use TYPO3\CMS\Install\Status\Exception;
 
 /**
  * Test case
@@ -42,10 +43,11 @@ class StatusUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
 
     /**
      * @test
-     * @expectedException \TYPO3\CMS\Install\Status\Exception
      */
     public function filterBySeverityThrowsExceptionIfObjectNotImplementingStatusInterfaceIsGiven()
     {
+        $this->expectException(Exception::class);
+        $this->expectExceptionCode(1366919442);
         $statusUtility = new StatusUtility();
         $statusUtility->filterBySeverity(array(new \stdClass()));
     }
index e5757cc..67095f2 100644 (file)
@@ -15,6 +15,7 @@ namespace TYPO3\CMS\Install\Tests\Unit\View;
  */
 
 use TYPO3\CMS\Core\Tests\UnitTestCase;
+use TYPO3\CMS\Install\Status\Exception;
 
 /**
  * Tests for the custom json view class
@@ -32,10 +33,11 @@ class JsonViewTest extends UnitTestCase
 
     /**
      * @test
-     * @expectedException \TYPO3\CMS\Install\Status\Exception
      */
     public function transformStatusArrayToArrayThrowsExceptionIfArrayContainsNotAMessageInterfaceMessage()
     {
+        $this->expectException(Exception::class);
+        $this->expectExceptionCode(1381059600);
         $jsonView = $this->getAccessibleMock(\TYPO3\CMS\Install\View\JsonView::class, array('dummy'));
         $jsonView->_call('transformStatusMessagesToArray', array('foo'));
     }