/** * Simple factory to create a new context connection * of the requested type. * * @return \AppserverIo\RemoteMethodInvocation\ConnectionInterface The requested context connection */ public static function createContextConnection() { // initialize the remote method call parser and the session storage $sessions = new ArrayList(); $parser = new RemoteMethodCallParser(); // initialize the remote context connection $contextConnection = new RemoteContextConnection(); $contextConnection->injectParser($parser); $contextConnection->injectSessions($sessions); // return the initialized connection return $contextConnection; }
/** * Tests the setter/getter for the port. * * @return void */ public function testSetterAndGetterForPort() { $this->contextConnection->injectPort(RemoteContextConnectionTest::PORT); $this->assertSame(RemoteContextConnectionTest::PORT, $this->contextConnection->getPort()); }