xrds.lib.test.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. require_once(api_get_path(SYS_CODE_PATH).'auth/openid/xrds.lib.php');
  3. class TestXrds extends UnitTestCase {
  4. public function __construct(){
  5. $this->UnitTestCase('XRDS library for OpenID - main/auth/openid/xrds.lib.test.php');
  6. }
  7. /*
  8. function testxrds_cdata() {
  9. global $xrds_open_elements, $xrds_services, $xrds_current_service;
  10. $parser='';
  11. $data='';
  12. $res=_xrds_cdata(&$parser, $data);
  13. $this->assertTrue(is_null($res));
  14. //var_dump($res);
  15. }
  16. */
  17. function testxrdsparse() {
  18. $xml = <<<XML
  19. <xml version="1.0">
  20. <users>
  21. <fname>Christian</fname>
  22. <lname>Fasa Fasa</lname>
  23. </users>
  24. XML;
  25. $parser = xrds_parse($xml);
  26. if (is_resource($parser)) {
  27. $this->assertTrue(is_resource($parser));
  28. } else {
  29. $this->assertTrue(is_null($parser));
  30. }
  31. }
  32. /*
  33. function test_xrds_element_end() {
  34. global $xrds_open_elements, $xrds_services, $xrds_current_service;
  35. $parser='';
  36. $name='';
  37. $xrds_current_service['version'] = 2;
  38. $xrds_current_service['version'] = 1;
  39. $xrds_services[] = $xrds_current_service;
  40. $xrds_current_service= array();
  41. $res=_xrds_element_end(&$parser, $name);
  42. $this->assertTrue(is_null($res));
  43. //var_dump($xrds_current_service);
  44. }
  45. function test_xrds_element_start() {
  46. global $xrds_open_elements;
  47. $name='';
  48. $attribs='';
  49. $res=_xrds_element_start(&$parser, $name, $attribs);
  50. $this->assertTrue(is_null($res));
  51. //var_dump($res);
  52. }
  53. function test_xrds_strip_namespace() {
  54. $name='';
  55. $res=_xrds_strip_namespace($name);
  56. $this->assertTrue(is_string($res));
  57. //var_dump($res);
  58. }*/
  59. }
  60. ?>