1<?php 2class BeforeAndAfterTest extends PHPUnit_Framework_TestCase 3{ 4 public static $beforeWasRun; 5 public static $afterWasRun; 6 7 public static function resetProperties() 8 { 9 self::$beforeWasRun = 0; 10 self::$afterWasRun = 0; 11 } 12 13 /** 14 * @before 15 */ 16 public function initialSetup() 17 { 18 self::$beforeWasRun++; 19 } 20 21 /** 22 * @after 23 */ 24 public function finalTeardown() 25 { 26 self::$afterWasRun++; 27 } 28 29 public function test1() 30 { 31 } 32 public function test2() 33 { 34 } 35} 36