@@ -74,7 +74,7 @@ public function testCellRender()
74
74
$ cell = $ this ->View ->cell ('Articles::teaserList ' );
75
75
$ render = "{$ cell }" ;
76
76
77
- $ this ->assertEquals ('teaser_list ' , $ cell ->template );
77
+ $ this ->assertEquals ('teaser_list ' , $ cell ->viewBuilder ()-> getTemplate () );
78
78
$ this ->assertContains ('<h2>Lorem ipsum</h2> ' , $ render );
79
79
$ this ->assertContains ('<h2>Usectetur adipiscing eli</h2> ' , $ render );
80
80
$ this ->assertContains ('<h2>Topis semper blandit eu non</h2> ' , $ render );
@@ -100,7 +100,7 @@ public function testCellImplictRenderWithError()
100
100
set_error_handler ($ capture );
101
101
102
102
$ cell = $ this ->View ->cell ('Articles::teaserList ' );
103
- $ cell ->template = 'nope ' ;
103
+ $ cell ->viewBuilder ()-> setTemplate ( 'nope ' ) ;
104
104
$ result = "{$ cell }" ;
105
105
}
106
106
@@ -128,12 +128,12 @@ public function testDefaultCellAction()
128
128
{
129
129
$ appCell = $ this ->View ->cell ('Articles ' );
130
130
131
- $ this ->assertEquals ('display ' , $ appCell ->template );
131
+ $ this ->assertEquals ('display ' , $ appCell ->viewBuilder ()-> getTemplate () );
132
132
$ this ->assertContains ('dummy ' , "{$ appCell }" );
133
133
134
134
$ pluginCell = $ this ->View ->cell ('TestPlugin.Dummy ' );
135
135
$ this ->assertContains ('dummy ' , "{$ pluginCell }" );
136
- $ this ->assertEquals ('display ' , $ pluginCell ->template );
136
+ $ this ->assertEquals ('display ' , $ pluginCell ->viewBuilder ()-> getTemplate () );
137
137
}
138
138
139
139
/**
@@ -143,11 +143,13 @@ public function testDefaultCellAction()
143
143
*/
144
144
public function testSettingCellTemplateFromAction ()
145
145
{
146
- $ appCell = $ this ->View ->cell ('Articles::customTemplate ' );
146
+ $ this ->deprecated (function () {
147
+ $ appCell = $ this ->View ->cell ('Articles::customTemplate ' );
147
148
148
- $ this ->assertContains ('This is the alternate template ' , "{$ appCell }" );
149
- $ this ->assertEquals ('alternate_teaser_list ' , $ appCell ->template );
150
- $ this ->assertEquals ('alternate_teaser_list ' , $ appCell ->viewBuilder ()->getTemplate ());
149
+ $ this ->assertContains ('This is the alternate template ' , "{$ appCell }" );
150
+ $ this ->assertEquals ('alternate_teaser_list ' , $ appCell ->viewBuilder ()->getTemplate ());
151
+ $ this ->assertEquals ('alternate_teaser_list ' , $ appCell ->template );
152
+ });
151
153
}
152
154
153
155
/**
@@ -160,7 +162,7 @@ public function testSettingCellTemplatePathFromAction()
160
162
$ appCell = $ this ->View ->cell ('Articles::customTemplatePath ' );
161
163
162
164
$ this ->assertContains ('Articles subdir custom_template_path template ' , "{$ appCell }" );
163
- $ this ->assertEquals ('custom_template_path ' , $ appCell ->template );
165
+ $ this ->assertEquals ('custom_template_path ' , $ appCell ->viewBuilder ()-> getTemplate () );
164
166
$ this ->assertEquals ('Cell/Articles/Subdir ' , $ appCell ->viewBuilder ()->getTemplatePath ());
165
167
}
166
168
@@ -287,7 +289,7 @@ public function testPluginNamespacedCell()
287
289
public function testPluginCellAlternateTemplate ()
288
290
{
289
291
$ cell = $ this ->View ->cell ('TestPlugin.Dummy::echoThis ' , ['msg ' => 'hello world! ' ]);
290
- $ cell ->template = '../../Element/translate ' ;
292
+ $ cell ->viewBuilder ()-> setTemplate ( '../../Element/translate ' ) ;
291
293
$ this ->assertContains ('This is a translatable string ' , "{$ cell }" );
292
294
}
293
295
@@ -479,9 +481,11 @@ public function testCachedRenderSimpleCustomTemplate()
479
481
->with ('cell_test_app_view_cell_articles_cell_customTemplate_default ' , "<h1>This is the alternate template</h1> \n" );
480
482
Cache::setConfig ('default ' , $ mock );
481
483
482
- $ cell = $ this ->View ->cell ('Articles::customTemplate ' , [], ['cache ' => true ]);
483
- $ result = $ cell ->render ();
484
- $ this ->assertContains ('This is the alternate template ' , $ result );
484
+ $ this ->deprecated (function () {
485
+ $ cell = $ this ->View ->cell ('Articles::customTemplate ' , [], ['cache ' => true ]);
486
+ $ result = $ cell ->render ();
487
+ $ this ->assertContains ('This is the alternate template ' , $ result );
488
+ });
485
489
486
490
Cache::drop ('default ' );
487
491
}
0 commit comments