Skip to content

Commit 2e1efa9

Browse files
committed
Adding tests for a trigger call for unknown event
1 parent bb2589f commit 2e1efa9

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

core/PHPRocks/EventHandler.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public function trigger($event_name, $arguments = [])
3333
call_user_func_array($event, $arguments);
3434
}
3535

36+
return true;
3637
}
3738

3839
/**

tests/PHPRocks/EventHandlerTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,4 +129,9 @@ public function testRemoveEventHandlerNotFoundEventDueClosure()
129129

130130
}
131131

132+
public function testTriggerUnknownEvent()
133+
{
134+
$this->assertNull($this->event_handler->trigger('random_event_this'));
135+
}
136+
132137
}

0 commit comments

Comments
 (0)