Exemple #1
0
 /**
  * Test behavior of overloaded states.
  */
 public function testExtendedStateWithCanonicalStateName()
 {
     $daughterInstance = new Daughter();
     $daughterInstance->enableState(StateThree::class);
     $this->assertEquals(666, $daughterInstance->method6());
     $grandDaughterInstace = new GrandDaughter();
     $grandDaughterInstace->enableState(StateThreeGD::class);
     $this->assertEquals(666, $grandDaughterInstace->method6());
     $this->assertEquals(777, $grandDaughterInstace->method7());
 }
 /**
  * Test behavior of overloaded states.
  */
 public function testExtendedState()
 {
     $daughterInstance = new Daughter();
     $daughterInstance->enableState('StateThree');
     $this->assertEquals(666, $daughterInstance->method6());
     $grandDaughterInstace = new GrandDaughter();
     $grandDaughterInstace->enableState('StateThree');
     $this->assertEquals(666, $grandDaughterInstace->method6());
     $this->assertEquals(777, $grandDaughterInstace->method7());
 }