From 407f2016d8cb842a930716c17e003e3e84827dc4 Mon Sep 17 00:00:00 2001 From: Hugo Vacher Date: Thu, 11 May 2017 11:21:37 -0400 Subject: [PATCH] Include class name inside factory not found error Mimics Laravel's original way of doing it and helps find what needs to be implemented. --- src/Testing/FactoryBuilder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Testing/FactoryBuilder.php b/src/Testing/FactoryBuilder.php index 319c17ae..e208b0fe 100644 --- a/src/Testing/FactoryBuilder.php +++ b/src/Testing/FactoryBuilder.php @@ -140,7 +140,7 @@ public function make(array $attributes = []) protected function makeInstance(array $attributes = []) { if (!isset($this->definitions[$this->class][$this->name])) { - throw new InvalidArgumentException("Unable to locate factory with name [{$this->name}]."); + throw new InvalidArgumentException("Unable to locate factory with name [{$this->name}] [{$this->class}]."); } $definition = call_user_func($this->definitions[$this->class][$this->name], $this->faker, $attributes);