1<?php 2class ClonedDependencyTest extends PHPUnit_Framework_TestCase 3{ 4 private static $dependency; 5 6 public static function setUpBeforeClass() 7 { 8 self::$dependency = new StdClass; 9 } 10 11 public function testOne() 12 { 13 return self::$dependency; 14 } 15 16 /** 17 * @depends testOne 18 */ 19 public function testTwo($dependency) 20 { 21 $this->assertSame(self::$dependency, $dependency); 22 } 23 24 /** 25 * @depends !clone testOne 26 */ 27 public function testThree($dependency) 28 { 29 $this->assertSame(self::$dependency, $dependency); 30 } 31 32 /** 33 * @depends clone testOne 34 */ 35 public function testFour($dependency) 36 { 37 $this->assertNotSame(self::$dependency, $dependency); 38 } 39} 40