API Use new names for renamed classes (#135)

This commit is contained in:
Guy Sartorelli 2024-09-23 14:38:44 +12:00 committed by GitHub
parent 76268db1d1
commit 62a47ff758
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 13 additions and 12 deletions

View File

@ -7,7 +7,7 @@ use SilverStripe\Core\Config\Config;
use SilverStripe\Core\Config\Configurable; use SilverStripe\Core\Config\Configurable;
use SilverStripe\ORM\DataObject; use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\DataObjectInterface; use SilverStripe\ORM\DataObjectInterface;
use SilverStripe\ORM\SS_List; use SilverStripe\Model\List\SS_List;
/** /**
* A DataFormatter object handles transformation of data from SilverStripe model objects to a particular output * A DataFormatter object handles transformation of data from SilverStripe model objects to a particular output

View File

@ -3,12 +3,12 @@
namespace SilverStripe\RestfulServer\DataFormatter; namespace SilverStripe\RestfulServer\DataFormatter;
use SilverStripe\RestfulServer\RestfulServer; use SilverStripe\RestfulServer\RestfulServer;
use SilverStripe\View\ArrayData; use SilverStripe\Model\ArrayData;
use SilverStripe\Core\Convert; use SilverStripe\Core\Convert;
use SilverStripe\RestfulServer\DataFormatter; use SilverStripe\RestfulServer\DataFormatter;
use SilverStripe\ORM\DataObjectInterface; use SilverStripe\ORM\DataObjectInterface;
use SilverStripe\Control\Director; use SilverStripe\Control\Director;
use SilverStripe\ORM\SS_List; use SilverStripe\Model\List\SS_List;
use SilverStripe\ORM\FieldType; use SilverStripe\ORM\FieldType;
/** /**

View File

@ -10,7 +10,7 @@ use SilverStripe\RestfulServer\DataFormatter;
use SilverStripe\ORM\DataObject; use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\DataObjectInterface; use SilverStripe\ORM\DataObjectInterface;
use SilverStripe\Control\Director; use SilverStripe\Control\Director;
use SilverStripe\ORM\SS_List; use SilverStripe\Model\List\SS_List;
use SilverStripe\RestfulServer\RestfulServer; use SilverStripe\RestfulServer\RestfulServer;
use InvalidArgumentException; use InvalidArgumentException;

View File

@ -8,12 +8,12 @@ use SilverStripe\Control\Director;
use SilverStripe\Control\HTTPRequest; use SilverStripe\Control\HTTPRequest;
use SilverStripe\Core\Config\Config; use SilverStripe\Core\Config\Config;
use SilverStripe\Core\Injector\Injector; use SilverStripe\Core\Injector\Injector;
use SilverStripe\ORM\ArrayList; use SilverStripe\Model\List\ArrayList;
use SilverStripe\ORM\DataList; use SilverStripe\ORM\DataList;
use SilverStripe\ORM\DataObject; use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\SS_List; use SilverStripe\Model\List\SS_List;
use SilverStripe\ORM\ValidationException; use SilverStripe\Core\Validation\ValidationException;
use SilverStripe\ORM\ValidationResult; use SilverStripe\Core\Validation\ValidationResult;
use SilverStripe\Security\Member; use SilverStripe\Security\Member;
use SilverStripe\Security\Security; use SilverStripe\Security\Security;

View File

@ -2,7 +2,7 @@
namespace SilverStripe\RestfulServer; namespace SilverStripe\RestfulServer;
use SilverStripe\ORM\SS_List; use SilverStripe\Model\List\SS_List;
/** /**
* Restful server handler for a single DataObject * Restful server handler for a single DataObject

View File

@ -20,6 +20,7 @@ use SilverStripe\Dev\SapphireTest;
use SilverStripe\RestfulServer\DataFormatter\JSONDataFormatter; use SilverStripe\RestfulServer\DataFormatter\JSONDataFormatter;
use Page; use Page;
use SilverStripe\Core\Config\Config; use SilverStripe\Core\Config\Config;
use SilverStripe\Core\Validation\ValidationException;
use SilverStripe\RestfulServer\DataFormatter\XMLDataFormatter; use SilverStripe\RestfulServer\DataFormatter\XMLDataFormatter;
class RestfulServerTest extends SapphireTest class RestfulServerTest extends SapphireTest
@ -747,7 +748,7 @@ class RestfulServerTest extends SapphireTest
// Assumption: XML is default output // Assumption: XML is default output
$formatter = new XMLDataFormatter(); $formatter = new XMLDataFormatter();
$responseArr = $formatter->convertStringToArray($response->getBody()); $responseArr = $formatter->convertStringToArray($response->getBody());
$this->assertEquals('SilverStripe\\ORM\\ValidationException', $responseArr['type']); $this->assertEquals(ValidationException::class, $responseArr['type']);
} }
public function testExceptionThrownWithPOST() public function testExceptionThrownWithPOST()

View File

@ -24,7 +24,7 @@ class RestfulServerTestValidationFailure extends DataObject implements TestOnly
); );
/** /**
* @return \SilverStripe\ORM\ValidationResult * @return \SilverStripe\Core\Validation\ValidationResult
*/ */
public function validate() public function validate()
{ {