Merge branch '2.7' into 2.8

This commit is contained in:
mark_story 2016-01-12 22:14:16 -05:00
commit d773644232
4 changed files with 9 additions and 5 deletions

View file

@ -185,8 +185,9 @@ class MemcachedEngine extends CacheEngine {
* @return array Array containing host, port * @return array Array containing host, port
*/ */
protected function _parseServerString($server) { protected function _parseServerString($server) {
if (strpos($server, 'unix://') === 0) { $socketTransport = 'unix://';
return array($server, 0); if (strpos($server, $socketTransport) === 0) {
return array(substr($server, strlen($socketTransport)), 0);
} }
if (substr($server, 0, 1) === '[') { if (substr($server, 0, 1) === '[') {
$position = strpos($server, ']:'); $position = strpos($server, ']:');

View file

@ -433,7 +433,7 @@ class MemcachedEngineTest extends CakeTestCase {
public function testParseServerStringUnix() { public function testParseServerStringUnix() {
$Memcached = new TestMemcachedEngine(); $Memcached = new TestMemcachedEngine();
$result = $Memcached->parseServerString('unix:///path/to/memcachedd.sock'); $result = $Memcached->parseServerString('unix:///path/to/memcachedd.sock');
$this->assertEquals(array('unix:///path/to/memcachedd.sock', 0), $result); $this->assertEquals(array('/path/to/memcachedd.sock', 0), $result);
} }
/** /**

View file

@ -107,7 +107,7 @@ class XmlViewTest extends CakeTestCase {
$Controller = new Controller($Request, $Response); $Controller = new Controller($Request, $Response);
$data = array( $data = array(
'_serialize' => array('tags'), '_serialize' => array('tags'),
'_xmlOptions' => array('format' => 'attributes'), '_xmlOptions' => array('format' => 'attributes', 'return' => 'domdocument'),
'tags' => array( 'tags' => array(
'tag' => array( 'tag' => array(
array( array(
@ -126,7 +126,7 @@ class XmlViewTest extends CakeTestCase {
$View = new XmlView($Controller); $View = new XmlView($Controller);
$result = $View->render(); $result = $View->render();
$expected = Xml::build(array('response' => array('tags' => $data['tags'])), $data['_xmlOptions'])->asXML(); $expected = Xml::build(array('response' => array('tags' => $data['tags'])), $data['_xmlOptions'])->saveXML();
$this->assertSame($expected, $result); $this->assertSame($expected, $result);
} }

View file

@ -142,6 +142,9 @@ class XmlView extends View {
$options['pretty'] = true; $options['pretty'] = true;
} }
if (isset($options['return']) && strtolower($options['return']) === 'domdocument') {
return Xml::fromArray($data, $options)->saveXML();
}
return Xml::fromArray($data, $options)->asXML(); return Xml::fromArray($data, $options)->asXML();
} }