A

Size: a a a
A
AM
️️
A
️️
g
️️
AM
АП
A
A
AM
АП
IG
public function hasError($response)
{
if (!empty($response))
return !isset($response->is_error);
return false;
}
DK
IG
public function testHasError()
{
$object = new stdClass();
$object->is_error = false;
$client = $this->getMockBuilder(Client::class)
->disableOriginalConstructor()
->getMock();
$client->expects($this->once())
->method('hasError')
->with($object)
->willReturn(true);
$this->assertTrue($client->hasError($object));
}
A
DK
public function testHasError()
{
$object = new stdClass();
$object->is_error = false;
$client = $this->getMockBuilder(Client::class)
->disableOriginalConstructor()
->getMock();
$client->expects($this->once())
->method('hasError')
->with($object)
->willReturn(true);
$this->assertTrue($client->hasError($object));
}
IG