コード例 #1
0
ファイル: ReturnObservableTest.php プロジェクト: voryx/Rx.PHP
 public function testReturnObservableSubscribeTwice()
 {
     $o = new ReturnObservable("The Value");
     $goodCount = 0;
     $o->subscribe(new CallbackObserver(function ($x) use(&$goodCount) {
         $this->assertEquals("The Value", $x);
         $goodCount++;
     }));
     $o->subscribe(new CallbackObserver(function ($x) use(&$goodCount) {
         $this->assertEquals("The Value", $x);
         $goodCount++;
     }));
     $this->assertEquals(2, $goodCount);
 }
コード例 #2
0
ファイル: WhereTest.php プロジェクト: Gasperowicz/Rx.PHP
 /**
  * @test
  * @expectedException InvalidArgumentException
  */
 public function it_throws_an_exception_if_predicate_is_not_a_callable()
 {
     $observable = new ReturnObservable(1);
     $observable->where(42);
 }
コード例 #3
0
ファイル: SelectTest.php プロジェクト: Gasperowicz/Rx.PHP
 /**
  * @test
  * @expectedException InvalidArgumentException
  */
 public function select_expects_a_callable()
 {
     $observable = new ReturnObservable(1);
     $observable->select(42);
 }
コード例 #4
0
ファイル: SkipTest.php プロジェクト: bluetechy/Rx.PHP
 /**
  * @test
  * @expectedException \InvalidArgumentException
  */
 public function it_throws_an_exception_on_negative_amounts()
 {
     $observable = new ReturnObservable(42);
     $observable->skip(-1);
 }
コード例 #5
0
ファイル: TakeTest.php プロジェクト: voryx/Rx.PHP
 /**
  * @test
  * @expectedException \InvalidArgumentException
  */
 public function it_throws_an_exception_on_negative_amounts()
 {
     $observable = new ReturnObservable(42);
     $result = $observable->take(-1);
     $result->subscribe(new CallbackObserver());
 }