Skip to content

Commit cf38ca7

Browse files
committed
fix test to provide error message
1 parent 2cfd98b commit cf38ca7

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tests/unit/SessionMonitorTest.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Tidal\WampWatch\Stub\ClientSessionStub;
1818
use PHPUnit_Framework_TestCase;
1919
use stdClass;
20+
use Thruway\Message;
2021

2122
/**
2223
* @author Timo Michna <[email protected]>
@@ -401,12 +402,13 @@ public function test_get_sessioninfo_fail_emits_event()
401402

402403
$monitor->getSessionInfo(654);
403404

404-
$sessionInfo = new stdClass();
405-
$sessionInfo->session = 654;
405+
$errorMessage = $this->getMockBuilder(Message\ErrorMessage::class)
406+
->disableOriginalConstructor()
407+
->getMock();
406408

407-
$stub->failCall(SessionMonitor::SESSION_INFO_TOPIC, $sessionInfo);
409+
$stub->failCall(SessionMonitor::SESSION_INFO_TOPIC, $errorMessage);
408410

409-
$this->assertSame($sessionInfo, $response);
411+
$this->assertSame($errorMessage, $response);
410412
}
411413

412414
public function test_invalid_sessioninfo_does_not_get_added()

0 commit comments

Comments
 (0)