Index: tests/phpunit/tests/user/query.php
===================================================================
--- tests/phpunit/tests/user/query.php	(revision 41336)
+++ tests/phpunit/tests/user/query.php	(working copy)
@@ -1434,4 +1434,47 @@
 		/* must not include user that has same string in other fields */
 		$this->assertEquals( array(), $ids );
 	}
+
+	/**
+	 * @ticket 41797
+	 */
+	public function test_max_num_pages() {
+
+		$q = new WP_User_Query( array(
+			'role'		=> 'author',
+			'number'	=> 3,
+		) );
+
+		$this->assertEquals( 4, $q->get_total() );
+		$this->assertEquals( 2, $q->max_num_pages );
+	}
+
+	/**
+	 * @ticket 41797
+	 */
+	public function test_max_num_pages_should_be_zero_for_count_total_false_and_number_positive() {
+
+		$q = new WP_User_Query( array(
+			'count_total' 	=> false,
+			'number' 	=> 1,
+	
+		) );
+
+		$this->assertEquals( 0, $q->max_num_pages );
+	}
+
+	/**
+	 * @ticket 41797
+	 */
+	public function test_max_num_pages_should_be_zero_for_count_total_true_and_no_number_set() {
+
+		$q = new WP_User_Query( array(
+			'count_total'	=> true,
+		) );
+
+		$this->assertEquals( 0, $q->max_num_pages );
+	}
+
+
+
 }
