diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2019-12-02 08:53:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-02 08:53:02 +0100 |
commit | 407c2c13ab7d2322127198b7a2ab77990c7b2190 (patch) | |
tree | 18d9ca8449a86b30d2b2f781bd5c6991f544dd61 /build | |
parent | e98ae45b8311d8d10aba2ec46830de02694f7f88 (diff) | |
parent | 330cb7047e7160431bb6a3c6ec0c596d1ecd9b11 (diff) | |
download | nextcloud-server-407c2c13ab7d2322127198b7a2ab77990c7b2190.tar.gz nextcloud-server-407c2c13ab7d2322127198b7a2ab77990c7b2190.zip |
Merge pull request #18159 from nextcloud/tests/comments-integration
Do not call count on null
Diffstat (limited to 'build')
-rw-r--r-- | build/integration/features/bootstrap/CommentsContext.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/build/integration/features/bootstrap/CommentsContext.php b/build/integration/features/bootstrap/CommentsContext.php index ce05b56689d..262ffc92b88 100644 --- a/build/integration/features/bootstrap/CommentsContext.php +++ b/build/integration/features/bootstrap/CommentsContext.php @@ -256,8 +256,12 @@ class CommentsContext implements \Behat\Behat\Context\Context { * @throws \Exception */ public function theResponseShouldContainOnlyComments($number) { - if (count($this->response) !== (int)$number) { - throw new \Exception("Found more comments than $number (" . count($this->response) . ")"); + $count = 0; + if ($this->response !== null) { + $count = count($this->response); + } + if ($count !== (int)$number) { + throw new \Exception("Found more comments than $number (" . $count . ")"); } } |