使用 jest 和酶测试函数 getenddate

问题描述

我一直试图在我的覆盖率报告中涵盖此功能,但是当我编写测试用例并尝试输入此 if 语句时,它不起作用

class MyObj implements JsonSerializable{
    protected $id;
    protected $name;

    function getId() { return $this->$id; }
    function getName() { return $this->$name; }
  
     public function jsonSerialize() {
                return [
                'Id' => $this->getId(),'Name' => $this->getName()
            ];
        }
}

// $arrofobj is array of objects of type MyObj 
json_encode($arrofobj);  //this will convert array of objects to JSON

我尝试将频率传递为每日以输入此 if case,但它甚至没有输入此路径。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)