0
0
mirror of https://github.com/salesagility/SuiteCRM.git synced 2024-11-22 16:02:36 +00:00
salesagility_SuiteCRM/tests/unit/phpunit/includes/GoogleSync/GoogleSyncMock.php
2023-07-18 15:53:47 +01:00

38 lines
826 B
PHP

<?php
require_once __DIR__ . '/../../../../../include/GoogleSync/GoogleSync.php';
/**
* GoogleSyncMock
*
* @author gyula
*/
#[\AllowDynamicProperties]
class GoogleSyncMock extends GoogleSync
{
public function setProperty($key, $value): void
{
$this->$key = $value;
}
public function getProperty($key)
{
if (!isset($this->$key)) {
if (!isset(parent::$key)) {
throw new Exception('Key is not set: ' . $key);
}
return parent::$key;
}
return $this->$key;
}
public function callMethod($name, $params = [])
{
if (!method_exists($this, $name)) {
throw new Exception('Method is not exists: ' . $name);
}
return call_user_func_array([$this, $name], (array)$params);
}
}