The problem probably stems from what you mean when you say your “root” directory.
In the DreamHost file system, your user’s “root” directory is “/home/yourusername”, and that is the directory you will find yourself in when logging in via FTP/SFTP. This directory is not web accessible.
Within that directory you will find directories named “yourdomain.tld” (by default), or whatever you selected when you “Added” the domain to the hosting system. Those directories are “web accessible”, and that is where you should put pages/scripts/etc. that you want to be able to reach on the web with a browser.
So, in order to be able to browse to “http://www.mydomain.com/test.php”, assuming you have added “mydomain.com” as a fully hosted domain in the Control Panel, you should place the “test.php” file in the “mydomain.com” directory beneath your user “root” directory, so that it “lives” in “/home/yourusername/mydomain.com/test.php”.