PHPUnit test $obj = new ProgTestClass() don't craate controller's object |
Hi All
I'm writing a small test and I want to check the value of a property after calling initController PHP Code: $obj = new \App\Controllers\Prog(); Unfortunately, after running the tests I get the following message: 1) App\Controllers\ProgTest::testinitController Error: Cannot access protected property App\Controllers\Prog::$baseOK I am using CI4 and phpunit PHPUnit 10.5.41 Thank you in advance for all replies
Use ReflectionHelper for protected properties.
https://github.com/codeigniter4/CodeIgni...er.php#L18 |
Welcome Guest, Not a member yet? Register Sign In |