File tree Expand file tree Collapse file tree 3 files changed +24
-6
lines changed Expand file tree Collapse file tree 3 files changed +24
-6
lines changed Original file line number Diff line number Diff line change 42
42
"autoload-dev" : {
43
43
"psr-4" : {
44
44
"Cake\\ Test\\ " : " tests" ,
45
+ "Company\\ TestPluginThree\\ Test\\ " : " tests/test_app/Plugin/Company/TestPluginThree/tests" ,
45
46
"TestApp\\ " : " tests/test_app/TestApp" ,
46
47
"TestPlugin\\ " : " tests/test_app/Plugin/TestPlugin/src" ,
47
48
"TestPlugin\\ Test\\ " : " tests/test_app/Plugin/TestPlugin/tests" ,
Original file line number Diff line number Diff line change @@ -150,12 +150,10 @@ protected function _loadFixtures($test)
150
150
} elseif ($ type === 'app ' ) {
151
151
$ baseNamespace = Configure::read ('App.namespace ' );
152
152
} elseif ($ type === 'plugin ' ) {
153
- if (strlen ($ additionalPath )) {
154
- list ($ plugin , $ additionalPath ) = explode ('. ' , $ additionalPath );
155
- } else {
156
- list ($ plugin , $ name ) = explode ('. ' , $ name );
157
- }
158
- $ baseNamespace = Inflector::camelize (str_replace ('\\' , '\ ' , $ plugin ));
153
+ list ($ plugin , $ name ) = explode ('. ' , $ pathName );
154
+ $ path = implode ('\\' , explode ('/ ' , $ plugin ));
155
+ $ baseNamespace = Inflector::camelize (str_replace ('\\' , '\ ' , $ path ));
156
+ $ additionalPath = null ;
159
157
} else {
160
158
$ name = $ fixture ;
161
159
}
Original file line number Diff line number Diff line change @@ -72,4 +72,23 @@ public function testFixturizePlugin()
72
72
$ fixtures ['plugin.test_plugin.articles ' ]
73
73
);
74
74
}
75
+
76
+ /**
77
+ * Test loading app fixtures.
78
+ *
79
+ * @return void
80
+ */
81
+ public function testFixturizeCustom ()
82
+ {
83
+ $ test = $ this ->getMock ('Cake\TestSuite\TestCase ' );
84
+ $ test ->fixtures = ['plugin.Company/TestPluginThree.articles ' ];
85
+ $ this ->manager ->fixturize ($ test );
86
+ $ fixtures = $ this ->manager ->loaded ();
87
+ $ this ->assertCount (1 , $ fixtures );
88
+ $ this ->assertArrayHasKey ('plugin.Company/TestPluginThree.articles ' , $ fixtures );
89
+ $ this ->assertInstanceOf (
90
+ 'Company\TestPluginThree\Test\Fixture\ArticlesFixture ' ,
91
+ $ fixtures ['plugin.Company/TestPluginThree.articles ' ]
92
+ );
93
+ }
75
94
}
You can’t perform that action at this time.
0 commit comments