Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: userc865b
Added: Jan 28, 2018 8:05 PM
Modified: Jan 28, 2018 10:16 PM
Views: 16
Tags: phpunit
accessPrivateOrProtectedMethod
  1. <?php    $test= new CriteriaDayTemp($weatherDataDummy->reveal());
  2.         $class = new \ReflectionClass ($test);
  3.         $method = $class->getMethod ('getCurrentTime');
  4.         $method->setAccessible(true);
  5.  
  6.  
  7.         $output = $method->invoke ($test);// calls the method
  8.         echo $output;