@@ -838,23 +838,27 @@ public function testForceDisconnect()
838838 // Arrange
839839 $ mock = new MockPlugin ();
840840 $ response = MockPlugin::getMockFile (
841- self ::$ mockBasePath . 'v2/project/APIKEY/connection/CONNECTIONID/delete '
841+ self ::$ mockBasePath . 'v2/project/APIKEY/session/SESSIONID/ connection/CONNECTIONID/delete '
842842 );
843843 $ mock ->addResponse ($ response );
844844 $ this ->client ->addSubscriber ($ mock );
845845
846+ // This sessionId was generated using a different apiKey, but this method doesn't do any
847+ // decoding to check, so its fine.
848+ $ sessionId = '2_MX44NTQ1MTF-flR1ZSBOb3YgMTIgMDk6NDA6NTkgUFNUIDIwMTN-MC43NjU0Nzh- ' ;
849+
846850 $ connectionId = '063e72a4-64b4-43c8-9da5-eca071daab89 ' ;
847851
848852 // Act
849- $ success = $ this ->opentok ->forceDisconnect ($ connectionId );
853+ $ success = $ this ->opentok ->forceDisconnect ($ sessionId , $ connectionId );
850854
851855 // Assert
852856 $ requests = $ mock ->getReceivedRequests ();
853857 $ this ->assertCount (1 , $ requests );
854858
855859 $ request = $ requests [0 ];
856860 $ this ->assertEquals ('DELETE ' , strtoupper ($ request ->getMethod ()));
857- $ this ->assertEquals ('/v2/project/ ' .$ this ->API_KEY .'/connection/ ' .$ connectionId , $ request ->getPath ());
861+ $ this ->assertEquals ('/v2/project/ ' .$ this ->API_KEY .'/session/ ' . $ sessionId . ' / connection/ ' .$ connectionId , $ request ->getPath ());
858862 $ this ->assertEquals ('api.opentok.com ' , $ request ->getHost ());
859863 $ this ->assertEquals ('https ' , $ request ->getScheme ());
860864
@@ -868,7 +872,7 @@ public function testForceDisconnect()
868872 // TODO: test the dynamically built User Agent string
869873 $ userAgent = $ request ->getHeader ('User-Agent ' );
870874 $ this ->assertNotEmpty ($ userAgent );
871- $ this ->assertStringStartsWith ('OpenTok-PHP-SDK/2.4.1-alpha.1 ' , $ userAgent ->__toString ());
875+ $ this ->assertStringStartsWith ('OpenTok-PHP-SDK/2.5.0 ' , $ userAgent ->__toString ());
872876
873877 $ this ->assertTrue ($ success );
874878 }
0 commit comments