Use assertCount() and getMockBuilder() in tests

getMock() was deprecated in PHPUnit 5.4.0.
This commit is contained in:
SpacePossum
2016-09-09 15:09:13 -04:00
committed by Jeremy Mikola
parent 83a285207b
commit 2d68309b14
3 changed files with 3 additions and 3 deletions
@@ -86,6 +86,6 @@ class ListenerPatternTest extends \PHPUnit_Framework_TestCase
private function getMockEventDispatcher()
{
return $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
return $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcherInterface')->getMock();
}
}
@@ -127,7 +127,7 @@ class WildcardEventDispatcherFunctionalTest extends \PHPUnit_Framework_TestCase
private function assertNumberListenersAdded($expected, $eventName = null)
{
return isset($eventName)
? $this->assertEquals($expected, count($this->dispatcher->getListeners($eventName)))
? $this->assertCount($expected, $this->dispatcher->getListeners($eventName))
: $this->assertEquals($expected, array_sum(array_map('count', $this->dispatcher->getListeners())));
}
}
@@ -148,7 +148,7 @@ class EventDispatcherTest extends \PHPUnit_Framework_TestCase
private function getMockEventDispatcher()
{
return $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
return $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcherInterface')->getMock();
}
}