Example #1
0
 /**
  * Test if the php behavior on private method in parent class
  * is keeped with an extending stated class (can not call).
  */
 public function testDaughterCanNotCallMotherPrivate()
 {
     $daughterInstance = new Daughter();
     $daughterInstance->enableState('StateTwo')->enableState('StateThree');
     try {
         $daughterInstance->methodRecallMotherPrivate();
     } catch (MethodNotImplemented $e) {
         //Good behavior
         return;
     } catch (\Exception $e) {
         $this->fail($e->getMessage());
         return;
     }
     $this->fail('Error privates methods must not be available for daughter methods');
 }