Welcome Guest, Not a member yet? Register   Sign In
PHPUnit test $obj = new ProgTestClass() don't craate controller's object
#1

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();
      $this->assertTrue$obj->baseOK ); 

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
Reply


Messages In This Thread
PHPUnit test $obj = new ProgTestClass() don't craate controller's object - by krychu_m - 01-19-2025, 05:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB