Category: reflection

Given object is not an instance of the class this method was declared in error when trying to set member variable inside PHPUnit test

I get the following error when trying to set the “logger” attribute on my class. ReflectionException: Given object is not an instance of the class this method was declared in public function testCheckForRecentActivity() { self::bootKernel(); $plan = new ReflectionClass(‘AppBundleServicesCoursesRevision0’); $logger…