home *** CD-ROM | disk | FTP | other *** search
/ PC World 2003 March / PCWorld_2003-03_cd.bin / Software / Vyzkuste / phptriad / phptriad2-2-1.exe / php / pear / tests / pear1.phpt < prev    next >
Encoding:
Text File  |  2001-04-14  |  1.1 KB  |  59 lines

  1. --TEST--
  2. PEAR constructor/destructor test
  3. --SKIPIF--
  4. --FILE--
  5. <?php
  6.  
  7. require_once "PEAR.php";
  8.  
  9. class TestPEAR extends PEAR {
  10.     function TestPEAR($name) {
  11.     $this->_debug = true;
  12.     $this->name = $name;
  13.     $this->PEAR();
  14.     }
  15.     function _TestPEAR() {
  16.     print "This is the TestPEAR($this->name) destructor\n";
  17.     $this->_PEAR();
  18.     }
  19. }
  20.  
  21. class Test2 extends PEAR {
  22.     function _Test2() {
  23.         print "This is the Test2 destructor\n";
  24.     $this->_PEAR();
  25.     }
  26. }
  27.  
  28. class Test3 extends Test2 {
  29. }
  30.  
  31. print "testing plain destructors\n";
  32. $o = new TestPEAR("test1");
  33. $p = new TestPEAR("test2");
  34. print "..\n";
  35. print "testing inherited destructors\n";
  36. $q = new Test3;
  37.  
  38. print "..\n";
  39. print "script exiting...\n";
  40. print "..\n";
  41.  
  42. ?>
  43. --GET--
  44. --POST--
  45. --EXPECT--
  46. testing plain destructors
  47. PEAR constructor called, class=testpear
  48. PEAR constructor called, class=testpear
  49. ..
  50. testing inherited destructors
  51. ..
  52. script exiting...
  53. ..
  54. This is the TestPEAR(test1) destructor
  55. PEAR destructor called, class=testpear
  56. This is the TestPEAR(test2) destructor
  57. PEAR destructor called, class=testpear
  58. This is the Test2 destructor
  59.