Files
yii/tests/framework/base/TestBehavior.php
2012-11-30 15:43:14 +01:00

22 lines
347 B
PHP

<?php
/**
*
*/
class TestBehavior extends CBehavior
{
public function events()
{
return array(
'onTestEvent' => 'handleTest',
);
}
public function handleTest($event)
{
if (!($event instanceof CEvent)) {
throw new CException('event has to be instance of CEvent');
}
$this->owner->behaviorEventHandled++;
}
}