Assuming test2.php is the PHP script you want to run, you are not passing variables, and you have *nix shell access, make a cron.txt file with the following:
Code:
0 0 * * * /full/path/to/php -f /full/path/to/test2.php > /full/path/to/log.txt
That says to run test2.php and dump any output to log.txt at midnight of every day. Then type
/full/path/to/crontab /full/path/to/cron.txt to set the cronjob.