示例#1
0
 /**
  * Test myList API
  */
 public function testMyList()
 {
     // Get 3 problems
     $author = UserFactory::createUser();
     $n = 3;
     for ($i = 0; $i < $n; $i++) {
         $problemData[$i] = ProblemsFactory::createProblem(null, null, 1, $author);
     }
     $r = new Request();
     $r["auth_token"] = $this->login($author);
     $response = ProblemController::apiMyList($r);
     $this->assertEquals(3, count($response["results"]));
     $this->assertEquals($problemData[2]["request"]["alias"], $response["results"][0]["alias"]);
 }