Example #1
0
 /**
  * Tests __call
  * @covers \Copycat\Standard\StdClass::__call()
  */
 public function testCall()
 {
     $class = new StdClass();
     $class->test = function () {
         return StdClassTest::TEST;
     };
     /** @noinspection PhpUndefinedMethodInspection */
     $this->assertEquals(self::TEST, $class->test());
     try {
         $caught = false;
         /** @noinspection PhpUndefinedMethodInspection */
         $class->testTest();
     } catch (Exception $exception) {
         $caught = true;
         $this->assertEquals('Method testTest is undefined', $exception->getMessage());
     }
     if (!$caught) {
         $this->fail('Exception was not caught');
     }
 }