Skip to content

Commit

Permalink
Merge pull request #260 from mbonneau/dealer-features
Browse files Browse the repository at this point in the history
Fix dealer role announcement for master branch
  • Loading branch information
mbonneau authored Jul 15, 2017
2 parents 37b7c64 + baf119e commit 6203cc7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
6 changes: 1 addition & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,17 @@ php:
- 5.6
- 7
- 7.1
- hhvm

matrix:
allow_failures:
- php: hhvm

before_install:
- export PATH=$HOME/.local/bin:$PATH
- pip install --user crossbar

before_script:
- composer install
- sh tests/Crossbar/travis_install

script:
- php tests/TestServer.php 20 & phpunit
- sh tests/Crossbar/run_tests
- php tests/TestServer.php 20 & vendor/bin/phpunit

2 changes: 1 addition & 1 deletion src/Thruway/Role/Dealer.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function getSubscribedRealmEvents()
"YieldMessageEvent" => ["handleYieldMessage", 10],
"ErrorMessageEvent" => ["handleErrorMessage", 10],
"LeaveRealm" => ["handleLeaveRealm", 10],
"SendWelcomeMessageEvent" => ["handleSendWelcomeMessage", 10]
"SendWelcomeMessageEvent" => ["handleSendWelcomeMessage", 20]
];
}

Expand Down
7 changes: 6 additions & 1 deletion tests/Unit/Peer/RouterTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
use Thruway\Message\WelcomeMessage;

/**
* Class RouterTest
Expand Down Expand Up @@ -110,8 +111,12 @@ public function testHelloMessage()
->method('sendMessage')
->with(
$this->callback(
function ($msg) {
function (WelcomeMessage $msg) {
$this->assertInstanceOf('\Thruway\Message\WelcomeMessage', $msg);
$this->assertNotEmpty($msg->getDetails());
$this->assertObjectHasAttribute('roles', $msg->getDetails());
$this->assertObjectHasAttribute('dealer', $msg->getDetails()->roles);
$this->assertObjectHasAttribute('broker', $msg->getDetails()->roles);

return $msg instanceof Thruway\Message\WelcomeMessage;
}
Expand Down

0 comments on commit 6203cc7

Please sign in to comment.