MDL-67353 favourites: Random DB id matching solved
commit7899cd4f6cf01a8ad04dcca0262815ba591d38aa
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Sun, 12 Jan 2020 12:20:33 +0000 (12 13:20 +0100)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Fri, 24 Jan 2020 10:26:56 +0000 (24 11:26 +0100)
tree485fc139d78d538423a0343bf285d70f0a6f369e
parent6a0cdf26eef5f17f0717b5b1e9960c7b165d083b
MDL-67353 favourites: Random DB id matching solved

Depending on the tests executed it was possible to arrive
to favourites tests with 2 "concepts" (say userid and contextid,
or userid and itemid) having the same ID.

Then, the array_diff() operations used by some mock stuff in the
tests wrongly was returning matches by value, ultimately causing
the test to fail.

Now, the matching is performed using array_diff_assoc() that takes
keys into considation when performing the match.
favourites/tests/component_favourite_service_test.php
favourites/tests/user_favourite_service_test.php