/** * @dataProvider eventsToAdd */ public function testAddEvent($event, $func) { Days_Event::add($event, $func); $observers = Days_Event::get($event); $this->assertFalse(empty($observers)); }
<?php Days_Event::add('system.send_content', 'del_whitespace'); function del_whitespace() { Days_Response::setContent(preg_replace('#\\s{2,}#', '', Days_Response::getContent())); }