0
0
Fork 0
mirror of https://github.com/salesagility/SuiteCRM.git synced 2025-02-11 16:58:54 +00:00
salesagility_SuiteCRM/tests/unit/phpunit/includes/GoogleSync/GoogleSyncMock.php
Dillon-Brown 26aab7535d Move test namespaces into autoload-dev
Signed-off-by: Dillon-Brown <dillon.brown@salesagility.com>
2021-09-08 16:49:16 +01:00

36 lines
799 B
PHP

<?php
require_once __DIR__ . '/../../../../../include/GoogleSync/GoogleSync.php';
/**
* GoogleSyncMock
*
* @author gyula
*/
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);
}
}