You can easily close a connection and remove it from the Doctrine connection registry with the following code:
// test.php
// ...
$conn = Doctrine_Manager::connection();
$manager->closeConnection($conn);
If you wish to close the connection but not remove it from the Doctrine connection registry you can use the following code instead:
// test.php
// ...
$conn = Doctrine_Manager::connection();
$conn->close();