Merge branch 'master' into 2.5

This commit is contained in:
mark_story 2013-11-21 21:46:21 -05:00
commit 71312932e8
4 changed files with 22 additions and 19 deletions
lib/Cake

View file

@ -1127,10 +1127,13 @@ class Model extends Object implements CakeEventListener {
public function setSource($tableName) {
$this->setDataSource($this->useDbConfig);
$db = ConnectionManager::getDataSource($this->useDbConfig);
$db->cacheSources = ($this->cacheSources && $db->cacheSources);
if (method_exists($db, 'listSources')) {
$restore = $db->cacheSources;
$db->cacheSources = ($restore && $this->cacheSources);
$sources = $db->listSources();
$db->cacheSources = $restore;
if (is_array($sources) && !in_array(strtolower($this->tablePrefix . $tableName), array_map('strtolower', $sources))) {
throw new MissingTableException(array(
'table' => $this->tablePrefix . $tableName,

View file

@ -689,8 +689,8 @@ class HttpSocket extends CakeSocket {
}
if (!empty($this->config['context']['ssl']['verify_host'])) {
$this->config['context']['ssl']['CN_match'] = $host;
unset($this->config['context']['ssl']['verify_host']);
}
unset($this->config['context']['ssl']['verify_host']);
}
/**

View file

@ -155,17 +155,17 @@ class ModelIntegrationTest extends BaseModelTest {
}
/**
* Tests that $cacheSources can only be disabled in the db using model settings, not enabled
* Tests that $cacheSources is restored despite the settings on the model.
*
* @return void
*/
public function testCacheSourcesDisabling() {
public function testCacheSourcesRestored() {
$this->loadFixtures('JoinA', 'JoinB', 'JoinAB', 'JoinC', 'JoinAC');
$this->db->cacheSources = true;
$TestModel = new JoinA();
$TestModel->cacheSources = false;
$TestModel->setSource('join_as');
$this->assertFalse($this->db->cacheSources);
$this->assertTrue($this->db->cacheSources);
$this->db->cacheSources = false;
$TestModel = new JoinA();

View file

@ -745,11 +745,11 @@ class RssHelperTest extends CakeTestCase {
),
'Alex',
'/dc:creator',
'description' => array(
'xy:description' => array(
'xmlns:dc' => 'http://link.com'
),
'descriptive words',
'/description',
'/xy:description',
'/item'
);
$this->assertTags($result, $expected, true);