Unit test failing due to bug in laravel