Skip to content
This repository was archived by the owner on Jan 31, 2020. It is now read-only.

Commit 001af84

Browse files
committed
Update Asset view helper tests to PHPUnit 5.7/6.0
- Use namespaced version of `PHPUnit\Framework\TestCase` - Convert `setExpectedException()` calls to `expectException()` + `expectExceptionMessage()`.
1 parent 1753631 commit 001af84

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

test/Helper/AssetTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
namespace ZendTest\View\Helper;
99

10-
use PHPUnit_Framework_TestCase as TestCase;
10+
use PHPUnit\Framework\TestCase;
1111
use Zend\ServiceManager\ServiceManager;
1212
use Zend\View\Exception;
1313
use Zend\View\Helper\Asset;
@@ -50,7 +50,8 @@ public function testHelperPluginManagerReturnsAssetHelperByClassName()
5050

5151
public function testInvalidAssetName()
5252
{
53-
$this->setExpectedException(Exception\InvalidArgumentException::class, 'Asset is not defined.');
53+
$this->expectException(Exception\InvalidArgumentException::class);
54+
$this->expectExceptionMessage('Asset is not defined');
5455

5556
$this->asset->__invoke('unknown');
5657
}

test/Helper/Service/AssetFactoryTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
namespace ZendTest\View\Helper\Service;
99

10-
use PHPUnit_Framework_TestCase as TestCase;
10+
use PHPUnit\Framework\TestCase;
1111
use Zend\ServiceManager\ServiceManager;
1212
use Zend\View\Exception;
1313
use Zend\View\Helper\Asset;
@@ -68,7 +68,8 @@ public function testInvalidConfiguration()
6868

6969
$assetFactory = new AssetFactory();
7070

71-
$this->setExpectedException(Exception\RuntimeException::class, 'Invalid resource map configuration.');
71+
$this->expectException(Exception\RuntimeException::class);
72+
$this->expectExceptionMessage('Invalid resource map configuration');
7273
$assetFactory($services, '');
7374
}
7475

0 commit comments

Comments
 (0)