mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Fix bad merge and failing test.
This commit is contained in:
parent
d63d51e3dd
commit
ab5bfdccfd
1 changed files with 18 additions and 3 deletions
|
@ -122,6 +122,20 @@ class RegisterCategory extends ClassRegisterModel {
|
||||||
*/
|
*/
|
||||||
public $name = 'RegisterCategory';
|
public $name = 'RegisterCategory';
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* RegisterPrefixedDs class
|
||||||
|
*
|
||||||
|
* @package Cake.Test.Case.Utility
|
||||||
|
*/
|
||||||
|
class RegisterPrefixedDs extends ClassRegisterModel {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* useDbConfig property
|
||||||
|
*
|
||||||
|
* @var string 'doesnotexist'
|
||||||
|
*/
|
||||||
|
public $useDbConfig = 'doesnotexist';
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Abstract class for testing ClassRegistry.
|
* Abstract class for testing ClassRegistry.
|
||||||
|
@ -291,17 +305,18 @@ class ClassRegistryTest extends CakeTestCase {
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function testPrefixedTestDatasource() {
|
public function testPrefixedTestDatasource() {
|
||||||
|
ClassRegistry::config(array('testing' => true));
|
||||||
$Model = ClassRegistry::init('RegisterPrefixedDs');
|
$Model = ClassRegistry::init('RegisterPrefixedDs');
|
||||||
$this->assertEqual($Model->useDbConfig, 'test');
|
$this->assertEquals('test', $Model->useDbConfig);
|
||||||
ClassRegistry::removeObject('RegisterPrefixedDs');
|
ClassRegistry::removeObject('RegisterPrefixedDs');
|
||||||
|
|
||||||
$testConfig = ConnectionManager::getDataSource('test')->config;
|
$testConfig = ConnectionManager::getDataSource('test')->config;
|
||||||
ConnectionManager::create('test_doesnotexist', $testConfig);
|
ConnectionManager::create('test_doesnotexist', $testConfig);
|
||||||
|
|
||||||
$Model = ClassRegistry::init('RegisterArticle');
|
$Model = ClassRegistry::init('RegisterArticle');
|
||||||
$this->assertEqual($Model->useDbConfig, 'test');
|
$this->assertEquals('test', $Model->useDbConfig);
|
||||||
$Model = ClassRegistry::init('RegisterPrefixedDs');
|
$Model = ClassRegistry::init('RegisterPrefixedDs');
|
||||||
$this->assertEqual($Model->useDbConfig, 'test_doesnotexist');
|
$this->assertEquals('test_doesnotexist', $Model->useDbConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue