File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,35 @@ public function compare_cold_observables()
4848 $ this ->assertMessages ([$ records1 ], [$ records2 ]);
4949 }
5050
51+ /**
52+ * @test
53+ */
54+ public function automatic_mock_observer_doesnt_create_loggable_subscription ()
55+ {
56+ $ inner = $ this ->createColdObservable ([
57+ onNext (150 , 1 ),
58+ onNext (200 , 2 ),
59+ onNext (250 , 3 ),
60+ onCompleted (300 ),
61+ ]);
62+ // Thanks to OnNextObservableNotification this internally creates
63+ // an instance of MockHigherOrderObserver which is not logged
64+ // by the ColdObservable::subscribe() method.
65+ $ records = onNext (100 , $ inner );
66+
67+ $ expected = onNext (100 , $ this ->createColdObservable ([
68+ onNext (150 , 1 ),
69+ onNext (200 , 2 ),
70+ onNext (250 , 3 ),
71+ onCompleted (300 ),
72+ ]));
73+
74+ $ this ->assertTrue ($ records ->equals ($ expected ));
75+ $ this ->assertMessages ([$ records ], [$ expected ]);
76+
77+ $ this ->assertSubscriptions ([], $ inner ->getSubscriptions ());
78+ }
79+
5180 /**
5281 * @test
5382 */
You can’t perform that action at this time.
0 commit comments