Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Higher-Order Marble tests #153

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
1a1b2e1
Preliminary marble testing
mbonneau Feb 4, 2017
fbeff95
more marble testing features
martinsik Feb 17, 2017
16e7304
fix correct type for str_repeat()
martinsik Feb 17, 2017
637d3fe
added marker groups support
martinsik Feb 17, 2017
654614a
Added expectObservable and expectSubscriptions to FunctionalTestCase
davidwdan Feb 18, 2017
4b91912
Added exception message support to expectObservable()->toBe()
davidwdan Feb 18, 2017
b2a3ae6
Added dispose support to expectObservable()
davidwdan Feb 18, 2017
3ea6d38
Rename MarbleDiagramError to MarbleDiagramException
mbonneau Feb 20, 2017
6147c65
Grouped marbles now happen at the same time
mbonneau Feb 20, 2017
a619b72
Grouped subscription marbles happen at the same time
mbonneau Feb 20, 2017
6e35541
Added interfaces so we get type hinting for `toBe`
davidwdan Feb 20, 2017
416034c
Fixed continues to actually continue the loop
davidwdan Feb 20, 2017
14b7fd3
Merge branch '2.x' of github.com:ReactiveX/RxPHP into marbleTest
davidwdan Mar 10, 2017
c1d2d4a
Cherry picked higher-order observable test from v1
davidwdan Mar 10, 2017
08b0e0a
use single instance of TestScheduler in all Notification objects
martinsik Mar 11, 2017
eb24667
Materialize the inner observable when converting the OnNextNotificati…
davidwdan Mar 11, 2017
8d219fa
Simplified `materializeObservable`
davidwdan Mar 11, 2017
c153965
Removed unused use statement
davidwdan Mar 11, 2017
ee4ec61
remove redundant test
martinsik Mar 12, 2017
58d185d
`toBe` now does a string comparison
davidwdan Mar 12, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed continues to actually continue the loop
  • Loading branch information
davidwdan committed Feb 20, 2017
commit 416034c6dc74296da64c12e703977482d4798385
24 changes: 11 additions & 13 deletions test/Rx/Functional/FunctionalTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,29 +159,29 @@ protected function convertMarblesToMessages(string $marbles, array $eventMap = [
case ' ':
case '^':
case '-': // nothing
continue;
continue 2;
case '#': // error
$events[] = onError($now, $customError ?? new \Exception());
continue;
continue 2;
case '|':
$events[] = onCompleted($now);
continue;
continue 2;
case '(':
if ($groupTime !== -1) {
throw new MarbleDiagramException('We\'re already inside a group');
}
$groupTime = $now;
continue;
continue 2;
case ')':
if ($groupTime === -1) {
throw new MarbleDiagramException('We\'re already outside of a group');
}
$groupTime = -1;
continue;
continue 2;
default:
$eventKey = $marbles[$i];
$events[] = onNext($now, isset($eventMap[$eventKey]) ? $eventMap[$eventKey] : $marbles[$i]);
continue;
continue 2;
}
}

Expand Down Expand Up @@ -230,25 +230,25 @@ protected function convertMarblesToSubscriptions(string $marbles, $startTime = 0
switch ($marbles[$i]) {
case ' ':
case '-':
continue;
continue 2;
case '(':
if ($groupTime !== -1) {
throw new MarbleDiagramException('We\'re already inside a group');
}
$groupTime = $now;
continue;
continue 2;
case ')':
if ($groupTime === -1) {
throw new MarbleDiagramException('We\'re already outside of a group');
}
$groupTime = -1;
continue;
continue 2;
case '^': // subscribe
if ($latestSubscription) {
throw new MarbleDiagramException('Trying to subscribe before unsubscribing the previous subscription.');
}
$latestSubscription = $now;
continue;
continue 2;
case '!': // unsubscribe
if (!$latestSubscription) {
throw new MarbleDiagramException('Trying to unsubscribe before subscribing.');
Expand All @@ -258,7 +258,6 @@ protected function convertMarblesToSubscriptions(string $marbles, $startTime = 0
break;
default:
throw new MarbleDiagramException('Only "^" and "!" markers are allowed in this diagram.');
continue;
}
}
if ($latestSubscription) {
Expand All @@ -277,13 +276,12 @@ protected function convertMarblesToDisposeTime(string $marbles, $startTime = 0)

switch ($marbles[$i]) {
case ' ':
continue;
continue 2;
case '!': // unsubscribe
$disposeAt = $now;
break;
default:
throw new MarbleDiagramException('Only " " and "!" markers are allowed in this diagram.');
continue;
}
}

Expand Down