HazardLibTest.php 966 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. */
  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. */
  18. public function testXssStrings() {
  19. $is = $this->HazardLib->xssStrings(false);
  20. //pr(h($is));
  21. $this->assertTrue(!empty($is));
  22. // cached
  23. Cache::delete('security_lib_texts');
  24. $is = $this->HazardLib->xssStrings();
  25. //pr(h($is));
  26. $this->assertTrue(!empty($is) && count($is), 113);
  27. $is = $this->HazardLib->xssStrings();
  28. //pr(h($is));
  29. $this->assertTrue(!empty($is) && count($is), 113);
  30. }
  31. public function testPhp() {
  32. $is = $this->HazardLib->phpStrings();
  33. //pr(h($is));
  34. }
  35. public function testSql() {
  36. $is = $this->HazardLib->sqlStrings();
  37. //pr(h($is));
  38. }
  39. }