Example #1
0
 public function testEmitUntilShouldReturnAsSoonAsCallbackReturnsTrue()
 {
     SignalSlot::connect('foo.bar', 'strpos');
     SignalSlot::connect('foo.bar', 'strstr');
     $responses = SignalSlot::emitUntil(function ($value) {
         return !$value;
     }, 'foo.bar', 'foo', 'f');
     $this->assertTrue($responses instanceof ResponseCollection);
     $this->assertSame(0, $responses->last());
 }
Example #2
0
 public function testEmitUntilShouldReturnAsSoonAsCallbackReturnsTrue()
 {
     SignalSlot::connect('foo.bar', 'strpos');
     SignalSlot::connect('foo.bar', 'strstr');
     $value = SignalSlot::emitUntil(function ($value) {
         return !$value;
     }, 'foo.bar', 'foo', 'f');
     $this->assertSame(0, $value);
 }