donglipi4495 2014-05-21 13:41
浏览 73
已采纳

assertContains没有得到正确的输出它是如何工作的?

i have a code like this but the assertion is not working . $user6_notification has user8 and user10 , how can i check the user id is in the user notification? assertContains

foreach ($user6_notification as $notification) {
            $this->assertContains($user8["id"],$notification->userId);
        }
  • 写回答

1条回答 默认 最新

  • dongxingchang9345 2014-05-22 05:04
    关注
    foreach ($user6_notification as $notification) {
        $this->assertContains($notification->userId, array($user8["id"], $user10["id"]));
    }
    

    Just changed the action in for loop. Got it.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?