mirror of
https://github.com/stan220/WildcardEventDispatcher.git
synced 2026-09-08 15:28:37 +00:00
Use assertCount() and getMockBuilder() in tests
getMock() was deprecated in PHPUnit 5.4.0.
This commit is contained in:
committed by
Jeremy Mikola
parent
83a285207b
commit
2d68309b14
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user