HazardLibTest.php 974 B

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