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:
parent
f902346b6c
commit
6bb129db2f
2 changed files with 4 additions and 4 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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();
|
||||||
|
|
Loading…
Reference in a new issue