public function testCallUnknownMethod() { $bar = new BarClass(); $behavior = new BarBehavior(); $this->setExpectedException('yii\\base\\UnknownMethodException'); $this->assertFalse($bar->hasMethod('nomagicBehaviorMethod')); $bar->attachBehavior('bar', $behavior); $bar->nomagicBehaviorMethod(); }
<?php echo BarClass::foo(); echo FooClass::foo();