コード例 #1
0
 public function testGetDispatchServerWebDAV()
 {
     $request = \Zend\Http\PhpEnvironment\Request::fromString("GET /index.php?frontend=webdav HTTP/1.1\r\n" . "User-Agent: SAMSUNG-GT-I9300/101.403");
     $request->setQuery(new \Zend\Stdlib\Parameters(array('frontend' => 'webdav')));
     $server = Tinebase_Core::getDispatchServer($request);
     $this->assertInstanceOf('Tinebase_Server_WebDAV', $server);
 }
 /**
  * test general functionality of Tinebase_Server_Plugin_WebDAV
  */
 public function testServerGetParameter()
 {
     $request = \Zend\Http\PhpEnvironment\Request::fromString("POST /index.php?frontend=webdav HTTP/1.1\r\n" . "Host: localhost\r\n" . "Depth: 0\r\n" . "User-Agent: Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20120824 Thunderbird/15.0 Lightning/1.7");
     $request->setQuery(new Zend\Stdlib\Parameters(array('frontend' => 'webdav')));
     $server = Tinebase_Core::getDispatchServer($request);
     $this->assertInstanceOf('Tinebase_Server_WebDAV', $server);
 }
 /**
  * test with post parameter requestType set to JSON
  */
 public function testServerPostParameter()
 {
     $request = \Zend\Http\PhpEnvironment\Request::fromString("POST /index.php?requestType=JSON HTTP/1.1\r\n" . "Host: localhost\r\n" . "User-Agent: Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20120824 Thunderbird/15.0 Lightning/1.7");
     $request->setPost(new Zend\Stdlib\Parameters(array('requestType' => 'JSON')));
     $server = Tinebase_Core::getDispatchServer($request);
     $this->assertInstanceOf('Tinebase_Server_Json', $server);
 }
コード例 #4
0
    /**
     * test general functionality of Voipmanager_Server_Plugin
     */
    public function testServerUserAgentAsterisk()
    {
        $request = \Zend\Http\PhpEnvironment\Request::fromString(<<<EOS
POST /index.php?frontend=activesync HTTP/1.1
Host: localhost
User-Agent: asterisk-libcurl-agent/1.0
EOS
);
        $server = Tinebase_Core::getDispatchServer($request);
        $this->assertInstanceOf('Voipmanager_Server_Asterisk', $server);
    }
コード例 #5
0
    /**
     * test general functionality of ActiveSync_Server_Plugin
     */
    public function testServerGetParameter()
    {
        $request = \Zend\Http\PhpEnvironment\Request::fromString(<<<EOS
POST /index.php?frontend=activesync HTTP/1.1
Host: localhost
Depth: 0
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20120824 Thunderbird/15.0 Lightning/1.7
EOS
);
        $request->setQuery(new Zend\Stdlib\Parameters(array('frontend' => 'activesync')));
        $server = Tinebase_Core::getDispatchServer($request);
        $this->assertInstanceOf('ActiveSync_Server_Http', $server);
    }