function testFileSearch() { // replace this with some actual testing code $searcher = new Filesearcher(dirname(__FILE__) . "/data"); $searcher->register(new \Pantheon\Checks\Exploited()); $searcher->register(new \Pantheon\Checks\Insecure()); $searcher->register(new \Pantheon\Checks\Sessions()); $searcher->execute(); foreach ($searcher->callbacks() as $check) { $this->assertNotEquals(0, $check->score); } Messenger::emit(); }
/** * checks the files for session_start() * * ## OPTIONS * * [--format=<format>] * : output as json * * ## EXAMPLES * * wp launchcheck sessions * */ public function sessions($args, $assoc_args) { $searcher = new \Pantheon\Filesearcher(getcwd() . '/wp-content'); $searcher->register(new \Pantheon\Checks\Sessions()); $format = isset($assoc_args['format']) ? $assoc_args['format'] : 'raw'; $searcher->execute(); $format = isset($assoc_args['format']) ? $assoc_args['format'] : 'raw'; \Pantheon\Messenger::emit($format); }