Skip to content

Commit

Permalink
Merge pull request #373 from SiM07/fix_phpunit_deprecations
Browse files Browse the repository at this point in the history
Fix ci warning caused by PHPUnit Api deprecation
  • Loading branch information
snc authored Nov 15, 2017
2 parents 0b93628 + b875eca commit 45425d9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Tests/CommandTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ abstract class CommandTestCase extends \PHPUnit_Framework_TestCase
*/
public function setUp()
{
$this->container = $this->getMock('\\Symfony\\Component\\DependencyInjection\\ContainerInterface');
$this->container = $this->getMockBuilder('\\Symfony\\Component\\DependencyInjection\\ContainerInterface')->getMock();

$kernel = $this->getMockBuilder('\\Symfony\\Component\\HttpKernel\\Kernel')
->disableOriginalConstructor()
Expand All @@ -60,7 +60,7 @@ public function setUp()
->will($this->returnValue($this->container));
$this->application = new Application($kernel);

$this->predisClient = $this->getMock('\\Predis\\Client');
$this->predisClient = $this->getMockBuilder('\\Predis\\Client')->getMock();

$this->phpredisClient = $this->getMockBuilder('PhpredisClient')
->disableOriginalConstructor()
Expand All @@ -73,7 +73,7 @@ public function setUp()

protected function registerPredisClient()
{
$this->predisClient = $this->getMock('\\Predis\\Client');
$this->predisClient = $this->getMockBuilder('\\Predis\\Client')->getMock();

$this->container->expects($this->once())
->method('get')
Expand Down
4 changes: 2 additions & 2 deletions Tests/Logger/RedisLoggerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ private function setUpWithPsrLogger()
$this->markTestSkipped('PSR-3 logger package is not installed.');
}

$this->logger = $this->getMock('Psr\Log\LoggerInterface');
$this->logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
$this->redisLogger = new RedisLogger($this->logger);
}

Expand All @@ -34,7 +34,7 @@ private function setUpWithHttpKernelLogger()
$this->markTestSkipped('The Symfony LoggerInterface is not available as Symfony 3+ is installed.');
}

$this->logger = $this->getMock('Symfony\Component\HttpKernel\Log\LoggerInterface');
$this->logger = $this->getMockBuilder('Symfony\Component\HttpKernel\Log\LoggerInterface')->getMock();
$this->redisLogger = new RedisLogger($this->logger);
}

Expand Down
5 changes: 4 additions & 1 deletion Tests/Session/Storage/Handler/RedisSessionHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ class RedisSessionHandlerTest extends \PHPUnit_Framework_TestCase

protected function setUp()
{
$this->redis = $this->getMock('Predis\Client', array('get', 'set', 'setex', 'del'));
$this->redis = $this
->getMockBuilder('Predis\Client')
->setMethods(array('get', 'set', 'setex', 'del'))
->getMock();
}

protected function tearDown()
Expand Down

0 comments on commit 45425d9

Please sign in to comment.