Skip to content

Commit

Permalink
#6 migrate Zend_Amf_Response_Http
Browse files Browse the repository at this point in the history
  • Loading branch information
Bui Sy Nguyen committed Apr 30, 2016
1 parent 6ae305e commit ebcabe7
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 35 deletions.
4 changes: 2 additions & 2 deletions fproject/Zend/Amf/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
use fproject\amf\Request;
use fproject\amf\HttpRequest;
use fproject\amf\Response;
use fproject\amf\HttpResponse;

/**
* An AMF gateway server implementation to allow the connection of the Adobe Flash Player to
Expand Down Expand Up @@ -720,8 +721,7 @@ public function setResponse($response)
public function getResponse()
{
if (null === ($response = $this->_response)) {
require_once 'Zend/Amf/Response/Http.php';
$this->setResponse(new Zend_Amf_Response_Http());
$this->setResponse(new HttpResponse());
}
return $this->_response;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,36 +1,29 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Amf
* @subpackage Response
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/
///////////////////////////////////////////////////////////////////////////////
//
// © Copyright f-project.net 2010-present.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
///////////////////////////////////////////////////////////////////////////////

use fproject\amf\Response;
namespace fproject\amf;

/**
* Creates the proper http headers and send the serialized AMF stream to standard out.
*
* @package Zend_Amf
* @subpackage Response
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Response_Http extends Response
class HttpResponse extends Response
{
/**
* Create the application response header for AMF and sends the serialized AMF string
Expand Down
9 changes: 3 additions & 6 deletions tests/Zend/Amf/Response/HttpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@
define('PHPUnit_MAIN_METHOD', 'Zend_Amf_Response_HttpTest::main');
}

/**
* @see Zend_Amf_Response_Http
*/
require_once 'Zend/Amf/Response/Http.php';
use fproject\amf\HttpResponse;

/**
* Test case for Response
Expand Down Expand Up @@ -68,10 +65,10 @@ public function testDoesNotEmitNoticeWhenHttpsServerKeyNotSet()
}

/**
* Expose Zend_Amf_Response_Http::isIeOverSsl for testing
* Expose HttpResponse::isIeOverSsl for testing
* @see ZF-11783
*/
class ZF11783_ExposeIsIeOverSsl extends Zend_Amf_Response_Http
class ZF11783_ExposeIsIeOverSsl extends HttpResponse
{
public function isIeOverSsl() {
return parent::isIeOverSsl();
Expand Down
3 changes: 2 additions & 1 deletion tests/Zend/Amf/ServerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
use fproject\amf\Request;
use fproject\amf\HttpRequest;
use fproject\amf\Response;
use fproject\amf\HttpResponse;

/**
* @category Zend
Expand Down Expand Up @@ -759,7 +760,7 @@ public function testSetResponseShouldAllowValidStringClassNames()
$this->_server->setResponse('fproject\amf\Response');
$response = $this->_server->getResponse();
$this->assertTrue($response instanceof Response);
$this->assertFalse($response instanceof Zend_Amf_Response_Http);
$this->assertFalse($response instanceof HttpResponse);
}

/**
Expand Down

0 comments on commit ebcabe7

Please sign in to comment.