Skip to content

Commit

Permalink
pushing up PHPUnit version and dealing with deprecated getMock
Browse files Browse the repository at this point in the history
  • Loading branch information
Malte Riesch committed Jun 6, 2016
1 parent 3eb82d3 commit 05e34de
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

},
"require-dev": {
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "4.1.*"
"mockery/mockery": "dev-master",
"phpunit/phpunit": "5.*"
},
"autoload": {
"psr-0": { "TestDbAcle": "lib/" },
Expand Down
7 changes: 5 additions & 2 deletions lib/TestDbAcle/PhpUnit/Mocks/MockablePdo.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ public function __construct() {
}

public static function createMock(\PHPUnit_Framework_TestCase $testCase, $methods = array()) {
$className = '\TestDbAcle\PhpUnit\Mocks\MockablePdo';
$mock = $testCase->getMock($className, $methods, array(), "_Mock_" . uniqid('MockablePdo'));
$className = 'TestDbAcle\PhpUnit\Mocks\MockablePdo';
$mock = $testCase->getMockBuilder($className)
->setMethods($methods)
->setMockClassName("_Mock_" . uniqid('MockablePdo'))
->getMock();
return $mock;
}
}
5 changes: 4 additions & 1 deletion tests/TestDbAcle/Db/BasePdoFacadeTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ class BasePdoFacadeTestCase extends \TestDbAcleTests\TestDbAcle\BaseTestCase
protected $mockPdo;

protected function createMock($className, $methods = array(), $constructorParameters = array()) {
$mock = $this->getMock($className, $methods, $constructorParameters, "_Mock_" . uniqid($className));
$mock = $this->getMockBuilder($className)
->setMethods($methods)
->setMockClassName("_Mock_" . uniqid($className))
->getMock();
return $mock;
}

Expand Down

0 comments on commit 05e34de

Please sign in to comment.