+ $this->assertEquals($count, $uf->getTotalUserCount());
+ }
+
+ /**
+ * @dataProvider simpleUserProvider
+ */
+ public function testSimpleProfile($query, $cond, $expcount = null)
+ {
+ /*
+ * @param $query A pair MySQL query (one for user selector, one for profile selector)
+ * @param $cond The UFC to test
+ * @param $expcount The expected number of results (-1 if that number is unknown)
+ */
+
+ $query = $query[1];
+
+ self::checkPlatal();
+
+ $query = XDB::query($query);
+ $count = $query->numRows();
+ if (!is_null($expcount)) {
+ if ($expcount < 0) {
+ $this->assertNotEquals(0, $count);
+ } else {
+ $this->assertEquals($expcount, $count);
+ }
+ }
+ $ids = $query->fetchColumn();
+ $this->assertEquals($count, count($ids));
+ sort($ids);
+
+ $uf = new UserFilter($cond);
+ $this->assertEquals($count, $uf->getTotalProfileCount());
+ $got = $uf->getPIDs();
+ $this->assertEquals($count, count($got));
+ sort($got);
+ $this->assertEquals($ids, $got);
+
+ $uf = new UserFilter($cond);
+ $got = $uf->getPIDs();
+ $this->assertEquals($count, count($got));
+ sort($got);
+ $this->assertEquals($ids, $got);
+ $this->assertEquals($count, $uf->getTotalProfileCount());