From 34118efbc646b082485609e234ea0cfe7fbcb4e7 Mon Sep 17 00:00:00 2001 From: UndefinedOffset Date: Mon, 7 Feb 2022 09:45:18 -0400 Subject: [PATCH] BUGFIX: Fixed issue where an undefined class error would be thrown when getting objects or ids from fixtures --- src/Dev/SapphireTest.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Dev/SapphireTest.php b/src/Dev/SapphireTest.php index ffcf459a0..668d8b7f8 100644 --- a/src/Dev/SapphireTest.php +++ b/src/Dev/SapphireTest.php @@ -2,6 +2,7 @@ namespace SilverStripe\Dev; use Exception; +use InvalidArgumentException; use LogicException; use PHPUnit_Framework_Constraint_Not; use PHPUnit_Extensions_GroupTestSuite; @@ -1814,7 +1815,7 @@ class SapphireTest extends PHPUnit_Framework_TestCase implements TestOnly $id = $state->getFixtureFactory(static::class)->getId($className, $identifier); if (!$id) { - throw new \InvalidArgumentException(sprintf( + throw new InvalidArgumentException(sprintf( "Couldn't find object '%s' (class: %s)", $identifier, $className @@ -1853,7 +1854,7 @@ class SapphireTest extends PHPUnit_Framework_TestCase implements TestOnly $obj = $state->getFixtureFactory(static::class)->get($className, $identifier); if (!$obj) { - throw new \InvalidArgumentException(sprintf( + throw new InvalidArgumentException(sprintf( "Couldn't find object '%s' (class: %s)", $identifier, $className