Add write composer.json in test
Add err check