Skip to content

Commit

Permalink
Merge branch 'release/0.4.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
tidal committed Sep 28, 2016
2 parents dc93176 + 4e506f7 commit 0e28998
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
### [0.4.1] - 2016-09-28

* Refactored Subscription\Collection
* Refactored MonitorTrait
* Added NotAuthorizedException
* Fixed several issues

### [0.4.0] - 2016-07-21

* Changed SessionMonitor to use promises instead of callbacks
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,9 @@
[![Codacy grade](https://img.shields.io/codacy/grade/05be2051d61543abb3bac6fee7af7b44.svg?maxAge=2592000&style=flat-square)](https://www.codacy.com/app/timomichna/WampWatch?utm_source=github.com&utm_medium=referral&utm_content=tidal/WampWatch&utm_campaign=Badge_Grade)
[![Codecov](https://img.shields.io/codecov/c/github/tidal/WampWatch.svg?maxAge=2592000&style=flat-square)](https://codecov.io/gh/tidal/WampWatch)
# WampWatch
A set of PHP WAMP v2 (Web Application Messaging Protocol) Monitor Clients to observe WAMP router meta-events (session, registration, subscription).
A set of PHP [WAMP v2](http://wamp-proto.org/) (Web Application Messaging Protocol) Monitor Clients to observe
WAMP router meta-events
([registration](https://tools.ietf.org/html/draft-oberstet-hybi-tavendo-wamp-02#section-13.3.7),
[subscription](https://tools.ietf.org/html/draft-oberstet-hybi-tavendo-wamp-02#section-13.6.3),
[session](https://tools.ietf.org/html/draft-oberstet-hybi-tavendo-wamp-02#section-13.7.1))

21 changes: 21 additions & 0 deletions tests/unit/SessionMonitorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,27 @@ public function test_get_sessioninfo_calls_event()
$this->assertSame($sessionInfo, $response);
}

public function test_get_sessioninfo_fail_emits_event()
{
$stub = new ClientSessionStub();
$stub->setSessionId(321);
$monitor = new SessionMonitor($stub);
$response = null;

$monitor->on('error', function ($res) use (&$response) {
$response = $res;
});

$monitor->getSessionInfo(654);

$sessionInfo = new stdClass();
$sessionInfo->session = 654;

$stub->failCall(SessionMonitor::SESSION_INFO_TOPIC, $sessionInfo);

$this->assertSame($sessionInfo, $response);
}

// STOP MONITOR TESTS


Expand Down

0 comments on commit 0e28998

Please sign in to comment.