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

Commit be9c248

Browse files
committed
Ignore deprecation errors
Now that controllers re-implement ServiceLocatorAwareInterface, we get deprecation errors. By adding `PHPUnit_Framework_Error_Deprecated::$enabled = false` to the setup on these tests, we can eliminate having those cast to exceptions, and thus prevent them from marking tests as errored or failed.
1 parent be0db28 commit be9c248

File tree

4 files changed

+19
-0
lines changed

4 files changed

+19
-0
lines changed

test/Application/ExceptionsRaisedInDispatchableShouldRaiseDispatchErrorEventTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,20 @@
99

1010
namespace ZendTest\Mvc\Application;
1111

12+
use PHPUnit_Framework_Error_Deprecated;
1213
use PHPUnit_Framework_TestCase as TestCase;
1314
use Zend\Mvc\MvcEvent;
1415

1516
class ExceptionsRaisedInDispatchableShouldRaiseDispatchErrorEventTest extends TestCase
1617
{
1718
use BadControllerTrait;
1819

20+
public function setUp()
21+
{
22+
// Ignore deprecation errors
23+
PHPUnit_Framework_Error_Deprecated::$enabled = false;
24+
}
25+
1926
/**
2027
* @group error-handling
2128
*/

test/Controller/IntegrationTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
namespace ZendTest\Mvc\Controller;
1111

12+
use PHPUnit_Framework_Error_Deprecated;
1213
use PHPUnit_Framework_TestCase as TestCase;
1314
use Zend\EventManager\EventManager;
1415
use Zend\EventManager\SharedEventManager;
@@ -21,6 +22,9 @@ class IntegrationTest extends TestCase
2122
{
2223
public function setUp()
2324
{
25+
// Ignore deprecation errors
26+
PHPUnit_Framework_Error_Deprecated::$enabled = false;
27+
2428
$this->sharedEvents = new SharedEventManager();
2529

2630
$this->services = new ServiceManager();

test/Controller/Plugin/ForwardTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
namespace ZendTest\Mvc\Controller\Plugin;
1111

12+
use PHPUnit_Framework_Error_Deprecated;
1213
use PHPUnit_Framework_TestCase as TestCase;
1314
use ReflectionClass;
1415
use stdClass;
@@ -51,6 +52,9 @@ class ForwardTest extends TestCase
5152

5253
public function setUp()
5354
{
55+
// Ignore deprecation errors
56+
PHPUnit_Framework_Error_Deprecated::$enabled = false;
57+
5458
$eventManager = $this->createEventManager(new SharedEventManager());
5559
$mockApplication = $this->getMock('Zend\Mvc\ApplicationInterface');
5660
$mockApplication->expects($this->any())->method('getEventManager')->will($this->returnValue($eventManager));

test/Service/ControllerManagerFactoryTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
namespace ZendTest\Mvc\Service;
1111

12+
use PHPUnit_Framework_Error_Deprecated;
1213
use PHPUnit_Framework_TestCase as TestCase;
1314
use Zend\EventManager\SharedEventManager;
1415
use Zend\Mvc\Service\ControllerManagerFactory;
@@ -34,6 +35,9 @@ class ControllerManagerFactoryTest extends TestCase
3435

3536
public function setUp()
3637
{
38+
// Ignore deprecation errors
39+
PHPUnit_Framework_Error_Deprecated::$enabled = false;
40+
3741
$loaderFactory = new ControllerManagerFactory();
3842
$this->defaultServiceConfig = [
3943
'aliases' => [

0 commit comments

Comments
 (0)