Permalink
Browse files

Add failing test for previous merge

  • Loading branch information...
1 parent fc7e36d commit 058620b1a9f17c3cd932d53d2fca58f0c25db817 @igorw committed Sep 4, 2012
Showing with 13 additions and 0 deletions.
  1. +13 −0 tests/Evenement/Tests/EventEmitterTest.php
@@ -66,6 +66,19 @@ public function testOnce()
$this->assertSame(1, $listenerCalled);
}
+ public function testOnceWithArguments()
+ {
+ $capturedArgs = [];
+
+ $this->emitter->once('foo', function ($a, $b) use (&$capturedArgs) {
+ $capturedArgs = array($a, $b);
+ });
+
+ $this->emitter->emit('foo', array('a', 'b'));
+
+ $this->assertSame(array('a', 'b'), $capturedArgs);
+ }
+
public function testEmitWithoutArguments()
{
$listenerCalled = false;

0 comments on commit 058620b

Please sign in to comment.