Add your virtual hosts to the first line:
127.0.0.1 localhost test.local work.local yii.local
And remove the last line.
That should do the trick. Your vhosts are now an alias for localhost. It’s not a good idea to have the same IP-address in multiple lines. This just confuses the DNS-cache.