The reason the addition of PHPUnit fails is because you have TWO keys named "require" in your composer.json, which is illegal. The last instance overwrites the first instance - which overwrites the added PHPUnit requirement.
Only after changing this to "require-dev", which is a different key, Composer can detect that you want PHPUnit.
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"laravel/framework": "4.1.*",
"laravelbook/ardent": "dev-master",
"phpunit/phpunit": "4.2.*" // i have also tried with 3.7 and 3.8
},
// deleted lines here...
"minimum-stability": "stable",
"require": {
"laravelbook/ardent": "dev-master"
}
}
See that mention of "require" as the last, badly indented key inside the JSON? This will confuse Composer at the least. I'm pretty sure "laravelbook/ardent" has a dependency on "laravel/framework" and plenty of additional stuff, so you didn't see that your first require key was overwritten.
Suggestion: Always use the command line to add stuff - it is way easier, and you don't have to take care of correct JSON formatting:
composer require --dev phpunit/phpunit:~4.0
This will add the dependency to the composer.json file and then download it right away if there are no conflicts. It will also write a new, cleanly formatted composer.json file. You'd have spotted your error quickly if Composer had the chance to remove the double key.