File tree Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -52,8 +52,8 @@ class ThemeView extends View {
52
52
*
53
53
* @param unknown_type $controller
54
54
*/
55
- function __construct (&$ controller ) {
56
- parent ::__construct ($ controller );
55
+ function __construct (&$ controller, $ register = true ) {
56
+ parent ::__construct ($ controller, $ register );
57
57
$ this ->theme =& $ controller ->theme ;
58
58
59
59
if (!empty ($ this ->theme )) {
Original file line number Diff line number Diff line change @@ -142,11 +142,11 @@ class ThemeViewTest extends CakeTestCase {
142
142
*/
143
143
function setUp () {
144
144
Router::reload ();
145
- $ this ->Controller = new Controller ();
146
- $ this ->PostsController = new ThemePostsController ();
145
+ $ this ->Controller =& new Controller ();
146
+ $ this ->PostsController =& new ThemePostsController ();
147
147
$ this ->PostsController ->viewPath = 'posts ' ;
148
148
$ this ->PostsController ->index ();
149
- $ this ->ThemeView = new ThemeView ($ this ->PostsController );
149
+ $ this ->ThemeView =& new ThemeView ($ this ->PostsController );
150
150
}
151
151
/**
152
152
* tearDown method
@@ -158,6 +158,19 @@ function tearDown() {
158
158
unset($ this ->ThemeView );
159
159
unset($ this ->PostsController );
160
160
unset($ this ->Controller );
161
+ ClassRegistry::flush ();
162
+ }
163
+ /**
164
+ * test that the theme view can be constructed without going into the registry
165
+ *
166
+ * @return void
167
+ */
168
+ function testConstructionNoRegister () {
169
+ ClassRegistry::flush ();
170
+ $ controller = null ;
171
+ $ Theme =& new ThemeView ($ controller , false );
172
+ $ ThemeTwo =& ClassRegistry::getObject ('view ' );
173
+ $ this ->assertFalse ($ ThemeTwo );
161
174
}
162
175
/**
163
176
* testPluginGetTemplate method
You can’t perform that action at this time.
0 commit comments