HazardLibTest.php 1002 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. App::uses('HazardLib', 'Tools.Lib');
  3. class HazardLibTest extends CakeTestCase {
  4. public function setUp() {
  5. parent::setUp();
  6. $this->HazardLib = new HazardLib();
  7. }
  8. /**
  9. * 2010-02-07 ms
  10. */
  11. public function _testParse() {
  12. $is = $this->HazardLib->_parseXml(HazardLib::URL);
  13. //pr(h($is));
  14. $this->assertTrue(!empty($is));
  15. $this->assertEquals(count($is), 113);
  16. }
  17. /**
  18. * 2010-02-07 ms
  19. */
  20. public function testXssStrings() {
  21. $is = $this->HazardLib->xssStrings(false);
  22. //pr(h($is));
  23. $this->assertTrue(!empty($is));
  24. # cached
  25. Cache::delete('security_lib_texts');
  26. $is = $this->HazardLib->xssStrings();
  27. //pr(h($is));
  28. $this->assertTrue(!empty($is) && count($is), 113);
  29. $is = $this->HazardLib->xssStrings();
  30. //pr(h($is));
  31. $this->assertTrue(!empty($is) && count($is), 113);
  32. }
  33. public function testPhp() {
  34. $is = $this->HazardLib->phpStrings();
  35. //pr(h($is));
  36. }
  37. public function testSql() {
  38. $is = $this->HazardLib->sqlStrings();
  39. //pr(h($is));
  40. }
  41. }