diff --git tests/phpunit/testcases/groups/class-bp-groups-group.php tests/phpunit/testcases/groups/class-bp-groups-group.php
index 826fa83..2b77772 100644
--- tests/phpunit/testcases/groups/class-bp-groups-group.php
+++ tests/phpunit/testcases/groups/class-bp-groups-group.php
@@ -136,6 +136,38 @@ class BP_Tests_BP_Groups_Group_TestCases extends BP_UnitTestCase {
 
 	/**
 	 * @group get
+	 * @group group_meta_query
+	 * @ticket BP5824
+	 */
+	public function test_get_with_meta_query_multiple_keys_with_same_value() {
+		$now = time();
+		$g1 = $this->factory->group->create( array(
+			'last_activity' => date( 'Y-m-d H:i:s', $now - 60*60 ),
+		) );
+		$g2 = $this->factory->group->create( array(
+			'last_activity' => date( 'Y-m-d H:i:s', $now - 60*60*2 ),
+		) );
+		groups_update_groupmeta( $g1, 'foo', 'bar' );
+		groups_update_groupmeta( $g2, 'foo', 'b' );
+		groups_update_groupmeta( $g2, 'foo2', 'bar' );
+
+		$groups = BP_Groups_Group::get( array(
+			'meta_query' => array(
+				'relation' => 'AND',
+				array(
+					'key' => 'foo',
+					'value' => 'bar',
+					'compare' => '='
+				),
+			),
+		) );
+		$ids = wp_list_pluck( $groups['groups'], 'id' );
+		$this->assertEquals( $ids, array( $g1 ) );
+		$this->assertEquals( 1, $groups['total'] );
+	}
+
+	/**
+	 * @group get
 	 */
 	public function test_get_normal_search() {
 		$g1 = $this->factory->group->create( array(
