Пример #1
0
 public function testExtend()
 {
     $returnValue = uniqid('return');
     $this->testInstance->extend('methodTesting', function () use($returnValue) {
         return $returnValue;
     }, true);
     $this->assertSame($returnValue, $this->testInstance->methodTesting());
     try {
         $this->testInstance->nonExistantMethod();
     } catch (\Exception $e) {
         $this->assertTrue($e instanceof \BadMethodCallException);
     }
 }