File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?php
2+
3+ /**
4+ * This file is part of CodeIgniter 4 framework.
5+ *
6+ * (c) CodeIgniter Foundation <admin@codeigniter.com>
7+ *
8+ * For the full copyright and license information, please view
9+ * the LICENSE file that was distributed with this source code.
10+ */
11+
12+ namespace Tests \Support \View \Cells ;
13+
14+ use CodeIgniter \View \Cells \Cell ;
15+
16+ class AwesomeCell extends Cell
17+ {
18+ public string $ message = 'Found! ' ;
19+ }
Original file line number Diff line number Diff line change 1+ <div><?= $ message ?> </div>
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ public function testGenerateCellSimpleName()
7373 $ this ->assertStringContainsString ('class Another extends Cell ' , $ contents );
7474
7575 // Check the view was generated
76- $ file = APPPATH . 'Cells/another_cell .php ' ;
76+ $ file = APPPATH . 'Cells/another .php ' ;
7777 $ this ->assertStringContainsString ('File created: ' , $ this ->getStreamFilterBuffer ());
7878 $ this ->assertFileExists ($ file );
7979 }
Original file line number Diff line number Diff line change 2121use Tests \Support \View \Cells \RenderedExtraDataNotice ;
2222use Tests \Support \View \Cells \RenderedNotice ;
2323use Tests \Support \View \Cells \SimpleNotice ;
24+ use Tests \Support \View \Cells \AwesomeCell ;
2425
2526/**
2627 * @internal
@@ -36,6 +37,13 @@ public function testCellRendersDefaultValues()
3637 $ this ->assertStringContainsString ('Hello World ' , $ result );
3738 }
3839
40+ public function testCellRendersViewWithActualClassName ()
41+ {
42+ $ result = view_cell (AwesomeCell::class);
43+
44+ $ this ->assertStringContainsString ('Found! ' , $ result );
45+ }
46+
3947 public function testCellWithNamedView ()
4048 {
4149 $ result = view_cell (SimpleNotice::class);
You can’t perform that action at this time.
0 commit comments