![]() |
help w/testing: variables not passed to view in 4.5.4 - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: help w/testing: variables not passed to view in 4.5.4 (/showthread.php?tid=92574) |
help w/testing: variables not passed to view in 4.5.4 - rramsey - 03-10-2025 Hi, I'm using 4.5.4 and I'm trying to set up some tests but I'm having a difficult time. This is the code from my controller: Code: $data['is_new'] = $is_new; PHP Code: <?php In my test, which I pretty much copied from the docs: PHP Code: <?php The error I'm getting is that $is_new is not defined in the view: Code: ErrorException: Undefined variable $is_new The page actually works just fine, no errors at all. I can go to the url, see the appropriate message based on whether or not I'm a new user. Any ideas? RE: help w/testing: variables not passed to view in 4.5.4 - ozornick - 03-10-2025 All ok. Code: > phpunit './tests/system/IndexTest.php' PHP Code: // app/Controllers/Home.php RE: help w/testing: variables not passed to view in 4.5.4 - rramsey - 03-10-2025 (03-10-2025, 08:21 AM)ozornick Wrote: All ok. Hmm. So something I either missed or didn't get in the code when I was stripping out the junk. |