Added method and tests for getNameFromUrl()