Add PHPUnit tests for dynamic credential updating