PageRenderTime 47ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/wspp/clients/tests/test_add_forum.php

https://bitbucket.org/systime/screening2
PHP | 40 lines | 30 code | 4 blank | 6 comment | 0 complexity | 16512ac13dfb8fd9cf0727b116d3dd1f MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1, GPL-3.0, BSD-3-Clause, LGPL-2.0
  1. <?php
  2. require_once ('../MoodleWS.php');
  3. $moodle=new MoodleWS();
  4. require_once ('../auth.php');
  5. /**test code for MoodleWS: add a forum
  6. * @param integer $client
  7. * @param string $sesskey
  8. * @param forumDatum $forum
  9. * @return editForumsOutput
  10. */
  11. $lr=$moodle->login(LOGIN,PASSWORD);
  12. $forum= new forumDatum();
  13. $forum->setAction('');
  14. $forum->setId(0);
  15. $forum->setCourse(0);
  16. $forum->setType('');
  17. $forum->setName('');
  18. $forum->setIntro('');
  19. $forum->setAssessed(0);
  20. $forum->setAssesstimestart(0);
  21. $forum->setAssesstimefinish(0);
  22. $forum->setScale(0);
  23. $forum->setMaxbytes(0);
  24. $forum->setForcesubscribe(0);
  25. $forum->setTrackingtype(0);
  26. $forum->setRsstype(0);
  27. $forum->setRssarticles(0);
  28. $forum->setTimemodified(0);
  29. $forum->setWarnafter(0);
  30. $forum->setBlockafter(0);
  31. $forum->setBlockperiod(0);
  32. $res=$moodle->add_forum($lr->getClient(),$lr->getSessionKey(),$forum);
  33. print_r($res);
  34. print($res->getForums());
  35. $moodle->logout($lr->getClient(),$lr->getSessionKey());
  36. ?>