1
1
Fork 0
mirror of https://code.mensbeam.com/MensBeam/Arsse.git synced 2024-12-22 21:22:40 +00:00

Mock correct method of Lang

This commit is contained in:
J. King 2017-03-28 19:58:20 -04:00
parent f902346b6c
commit 6bb129db2f
2 changed files with 4 additions and 4 deletions

View file

@ -8,8 +8,8 @@ class TestException extends \PHPUnit\Framework\TestCase {
function setUp() { function setUp() {
$this->clearData(false); $this->clearData(false);
$m = $this->getMockBuilder(Lang::class)->setMethods(['__invoke'])->getMock(); $m = $this->getMockBuilder(Lang::class)->setMethods(['msg'])->getMock();
$m->expects($this->any())->method("__invoke")->with($this->anything(), $this->anything())->will($this->returnValue("")); $m->expects($this->any())->method("msg")->with($this->anything(), $this->anything())->will($this->returnValue(""));
Data::$l = $m; Data::$l = $m;
} }

View file

@ -36,8 +36,8 @@ trait Setup {
$this->l = new Lang($this->path); $this->l = new Lang($this->path);
// create a mock Lang object to keep exceptions from creating loops // create a mock Lang object to keep exceptions from creating loops
$this->clearData(false); $this->clearData(false);
$m = $this->getMockBuilder(Lang::class)->setMethods(['__invoke'])->getMock(); $m = $this->getMockBuilder(Lang::class)->setMethods(['msg'])->getMock();
$m->expects($this->any())->method("__invoke")->with($this->anything(), $this->anything())->will($this->returnValue("")); $m->expects($this->any())->method("msg")->with($this->anything(), $this->anything())->will($this->returnValue(""));
Data::$l = $m; Data::$l = $m;
// call the additional setup method if it exists // call the additional setup method if it exists
if(method_exists($this, "setUpSeries")) $this->setUpSeries(); if(method_exists($this, "setUpSeries")) $this->setUpSeries();