Skip to content

Commit 21a3e8f

Browse files
committed
Update test case Model folder
1 parent 540922a commit 21a3e8f

File tree

8 files changed

+35
-29
lines changed

8 files changed

+35
-29
lines changed

lib/Cake/Test/TestCase/Model/AclNodeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ public function testNodeAliasParenting() {
365365
*/
366366
public function testNodeActionAuthorize() {
367367
App::build(array(
368-
'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
368+
'Plugin' => array(CAKE . 'Test' . DS . 'TestApp' . DS . 'Plugin' . DS)
369369
), App::RESET);
370370
CakePlugin::load('TestPlugin');
371371

lib/Cake/Test/TestCase/Model/BehaviorCollectionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ public function testLoadAlias() {
460460
$this->assertEquals('working', $Apple->testMethod(true));
461461
$this->assertEquals('working', $Apple->Behaviors->dispatchMethod($Apple, 'testMethod'));
462462

463-
App::build(array('Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)));
463+
App::build(array('Plugin' => array(CAKE . 'Test' . DS . 'TestApp' . DS . 'Plugin' . DS)));
464464
CakePlugin::load('TestPlugin');
465465
$this->assertTrue($Apple->Behaviors->load('SomeOther', array('className' => 'TestPlugin.TestPluginPersisterOne')));
466466
$this->assertInstanceOf('TestPluginPersisterOneBehavior', $Apple->Behaviors->SomeOther);

lib/Cake/Test/TestCase/Model/CakeSchemaTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ public function testSchemaReadWithConfigPrefix() {
683683
public function testSchemaReadWithPlugins() {
684684
App::objects('model', null, false);
685685
App::build(array(
686-
'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
686+
'Plugin' => array(CAKE . 'Test' . DS . 'TestApp' . DS . 'Plugin' . DS)
687687
));
688688
CakePlugin::load('TestPlugin');
689689

@@ -1049,7 +1049,7 @@ public function testSchemaLoading() {
10491049
*/
10501050
public function testSchemaLoadingFromPlugin() {
10511051
App::build(array(
1052-
'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
1052+
'Plugin' => array(CAKE . 'Test' . DS . 'TestApp' . DS . 'Plugin' . DS)
10531053
));
10541054
CakePlugin::load('TestPlugin');
10551055
$Other = $this->Schema->load(array('name' => 'TestPluginApp', 'plugin' => 'TestPlugin'));

lib/Cake/Test/TestCase/Model/ConnectionManagerTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function testEnumConnectionObjects() {
5555
public function testGetDataSource() {
5656
App::build(array(
5757
'Model/Datasource' => array(
58-
CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS . 'Datasource' . DS
58+
CAKE . 'Test' . DS . 'TestApp' . DS . 'Model' . DS . 'Datasource' . DS
5959
)
6060
));
6161

@@ -88,7 +88,7 @@ public function testGetDataSourceException() {
8888
*/
8989
public function testGetPluginDataSource() {
9090
App::build(array(
91-
'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
91+
'Plugin' => array(CAKE . 'Test' . DS . 'TestApp' . DS . 'Plugin' . DS)
9292
), App::RESET);
9393
CakePlugin::load('TestPlugin');
9494
$name = 'test_source';
@@ -109,7 +109,7 @@ public function testGetPluginDataSource() {
109109
*/
110110
public function testGetPluginDataSourceAndPluginDriver() {
111111
App::build(array(
112-
'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
112+
'Plugin' => array(CAKE . 'Test' . DS . 'TestApp' . DS . 'Plugin' . DS)
113113
), App::RESET);
114114
CakePlugin::load('TestPlugin');
115115
$name = 'test_plugin_source_and_driver';
@@ -132,7 +132,7 @@ public function testGetPluginDataSourceAndPluginDriver() {
132132
*/
133133
public function testGetLocalDataSourceAndPluginDriver() {
134134
App::build(array(
135-
'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
135+
'Plugin' => array(CAKE . 'Test' . DS . 'TestApp' . DS . 'Plugin' . DS)
136136
));
137137
CakePlugin::load('TestPlugin');
138138
$name = 'test_local_source_and_plugin_driver';
@@ -154,9 +154,9 @@ public function testGetLocalDataSourceAndPluginDriver() {
154154
*/
155155
public function testGetPluginDataSourceAndLocalDriver() {
156156
App::build(array(
157-
'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
157+
'Plugin' => array(CAKE . 'Test' . DS . 'TestApp' . DS . 'Plugin' . DS),
158158
'Model/Datasource/Database' => array(
159-
CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS . 'Datasource' . DS . 'Database' . DS
159+
CAKE . 'Test' . DS . 'TestApp' . DS . 'Model' . DS . 'Datasource' . DS . 'Database' . DS
160160
)
161161
));
162162

@@ -270,9 +270,9 @@ public function testCreateDataSourceWithIntegrationTests() {
270270
*/
271271
public function testConnectionData() {
272272
App::build(array(
273-
'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
273+
'Plugin' => array(CAKE . 'Test' . DS . 'TestApp' . DS . 'Plugin' . DS),
274274
'Model/Datasource' => array(
275-
CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS . 'Datasource' . DS
275+
CAKE . 'Test' . DS . 'TestApp' . DS . 'Model' . DS . 'Datasource' . DS
276276
)
277277
), App::RESET);
278278
CakePlugin::load(array('TestPlugin', 'TestPluginTwo'));
@@ -332,7 +332,7 @@ public function testConnectionData() {
332332
public function testDrop() {
333333
App::build(array(
334334
'Model/Datasource' => array(
335-
CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS . 'Datasource' . DS
335+
CAKE . 'Test' . DS . 'TestApp' . DS . 'Model' . DS . 'Datasource' . DS
336336
)
337337
));
338338
ConnectionManager::create('droppable', array('datasource' => 'Test2Source'));

lib/Cake/Test/TestCase/Model/Datasource/CakeSessionTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -537,9 +537,9 @@ public function testReadAndWriteWithCakeStorage() {
537537
public function testUsingAppLibsHandler() {
538538
App::build(array(
539539
'Model/Datasource/Session' => array(
540-
CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS . 'Datasource' . DS . 'Session' . DS
540+
CAKE . 'Test' . DS . 'TestApp' . DS . 'Model' . DS . 'Datasource' . DS . 'Session' . DS
541541
),
542-
'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
542+
'Plugin' => array(CAKE . 'Test' . DS . 'TestApp' . DS . 'Plugin' . DS)
543543
), App::RESET);
544544
Configure::write('Session', array(
545545
'defaults' => 'cake',
@@ -560,7 +560,7 @@ public function testUsingAppLibsHandler() {
560560
*/
561561
public function testUsingPluginHandler() {
562562
App::build(array(
563-
'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
563+
'Plugin' => array(CAKE . 'Test' . DS . 'TestApp' . DS . 'Plugin' . DS)
564564
), App::RESET);
565565
CakePlugin::load('TestPlugin');
566566

lib/Cake/Test/TestCase/Model/Datasource/DataSourceTest.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@
1717
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
1818
*/
1919

20-
App::uses('Model', 'Model');
21-
App::uses('DataSource', 'Model/Datasource');
20+
namespace Cake\Test\TestCase\Model\Datasource;
21+
use Cake\TestSuite\TestCase,
22+
Cake\Model\Model,
23+
Cake\Model\ConnectionManager,
24+
Cake\Model\Datasource\DataSource;
2225

2326
/**
2427
* TestSource
@@ -94,7 +97,7 @@ public function calculate(Model $Model, $func, $params = array()) {
9497
*
9598
* @package Cake.Test.Case.Model.Datasource
9699
*/
97-
class DataSourceTest extends CakeTestCase {
100+
class DataSourceTest extends TestCase {
98101

99102
/**
100103
* Name of test source
@@ -111,15 +114,15 @@ class DataSourceTest extends CakeTestCase {
111114
public function setUp() {
112115
parent::setUp();
113116
$this->Source = $this->getMock(
114-
'TestSource',
117+
__NAMESPACE__ . '\TestSource',
115118
array('create', 'read', 'update', 'delete')
116119
);
117120
ConnectionManager::create($this->sourceName, array(
118121
'datasource' => get_class($this->Source),
119122
'apiKey' => '1234abcd',
120123
));
121124
$this->Model = $this->getMock(
122-
'Model',
125+
'Cake\Model\Model',
123126
array('getDataSource'),
124127
array(array('ds' => $this->sourceName))
125128
);

lib/Cake/Test/TestCase/Model/Datasource/Database/MysqlTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ public function testAlterSchemaIndexes() {
611611
public function testBlobSaving() {
612612
$this->loadFixtures('BinaryTest');
613613
$this->Dbo->cacheSources = false;
614-
$data = file_get_contents(CAKE . 'Test' . DS . 'test_app' . DS . 'webroot' . DS . 'img' . DS . 'cake.power.gif');
614+
$data = file_get_contents(CAKE . 'Test' . DS . 'TestApp' . DS . 'webroot' . DS . 'img' . DS . 'cake.power.gif');
615615

616616
$model = new CakeTestModel(array('name' => 'BinaryTest', 'ds' => 'test'));
617617
$model->save(compact('data'));

lib/Cake/Test/TestCase/Model/models.php

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@
1818
* @since CakePHP(tm) v 1.2.0.6464
1919
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
2020
*/
21-
App::uses('Model', 'Model');
21+
namespace Cake\Test\TestCase\Model;
22+
use Cake\TestSuite\Fixture\TestModel as CakeTestModel,
23+
Cake\Model\Model;
24+
2225
/**
2326
* AppModel class
2427
*
@@ -615,7 +618,7 @@ public function afterFind($results, $primary = false) {
615618
*
616619
* @package Cake.Test.Case.Model
617620
*/
618-
class MergeVarPluginAppModel extends AppModel {
621+
class MergeVarPluginAppModel extends Model {
619622

620623
/**
621624
* actsAs parameter
@@ -4752,7 +4755,7 @@ class ScaffoldMock extends CakeTestModel {
47524755
*/
47534756
public $belongsTo = array(
47544757
'User' => array(
4755-
'className' => 'ScaffoldUser',
4758+
'className' => 'Cake\Test\TestCase\Model\ScaffoldUser',
47564759
'foreignKey' => 'user_id',
47574760
)
47584761
);
@@ -4764,7 +4767,7 @@ class ScaffoldMock extends CakeTestModel {
47644767
*/
47654768
public $hasMany = array(
47664769
'Comment' => array(
4767-
'className' => 'ScaffoldComment',
4770+
'className' => 'Cake\Test\TestCase\Model\ScaffoldComment',
47684771
'foreignKey' => 'article_id',
47694772
)
47704773
);
@@ -4776,7 +4779,7 @@ class ScaffoldMock extends CakeTestModel {
47764779
*/
47774780
public $hasAndBelongsToMany = array(
47784781
'ScaffoldTag' => array(
4779-
'className' => 'ScaffoldTag',
4782+
'className' => 'Cake\Test\TestCase\Model\ScaffoldTag',
47804783
'foreignKey' => 'something_id',
47814784
'associationForeignKey' => 'something_else_id',
47824785
'joinTable' => 'join_things'
@@ -4806,7 +4809,7 @@ class ScaffoldUser extends CakeTestModel {
48064809
*/
48074810
public $hasMany = array(
48084811
'Article' => array(
4809-
'className' => 'ScaffoldMock',
4812+
'className' => 'Cake\Test\TestCase\Model\ScaffoldMock',
48104813
'foreignKey' => 'article_id',
48114814
)
48124815
);
@@ -4833,7 +4836,7 @@ class ScaffoldComment extends CakeTestModel {
48334836
*/
48344837
public $belongsTo = array(
48354838
'Article' => array(
4836-
'className' => 'ScaffoldMock',
4839+
'className' => 'Cake\Test\TestCase\Model\ScaffoldMock',
48374840
'foreignKey' => 'article_id',
48384841
)
48394842
);

0 commit comments

Comments
 (0)