How can I use a helper in a unit test? |
Hi there!
Here is my problem:
Code: Error: Call to undefined function character_limiter() I tried pretty much everything to allow the tests to recognize that function, even putting that ugly line at the beginning of my test case: PHP Code: require_once(ROOTPATH . '/vendor/codeigniter4/framework/system/Helpers/text_helper.php'); Unfortunately, even that doesn't work, for ROOTPATH isn't defined by PHPUnit (obviously, silly me). What is the best practice to test a model (or anything else for that mater) that uses a helper function? Do I need to modifiy my test or my code? And how? Thanks in advance for your kind answers! |
Messages In This Thread |
How can I use a helper in a unit test? - by SteeveDroz - 12-06-2019, 12:15 AM
RE: How can I use a helper in a unit test? - by ciadmin - 12-06-2019, 06:03 AM
RE: How can I use a helper in a unit test? - by SteeveDroz - 12-07-2019, 01:08 AM
|