Is this mock necessary ? If I'm not missing a point the DirectoryNamer don't make any assertions against $file object.