Open
Description
Is it possible to use the mocked json_decode for unit testing SomeClass::someMethod?
Where in someMethod() contains json_decode?
Summarized code snippet:
test Method:
PHPMockery::mock(NAMESPACE, "json_decode")
->andReturn("test");
$classMock = new SomeClass();
$actual = $classMock->someMethod();
$this->assertEquals("test", $actual);
SomeClass::someMethod:
// codes here
$var = json_decode($str);
// codes here
Metadata
Metadata
Assignees
Labels
No labels