diff --git a/src/DataFormatter.php b/src/DataFormatter.php index c0109c1..e3f4e5a 100644 --- a/src/DataFormatter.php +++ b/src/DataFormatter.php @@ -7,7 +7,7 @@ use SilverStripe\Core\Config\Config; use SilverStripe\Core\Config\Configurable; use SilverStripe\ORM\DataObject; 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 diff --git a/src/DataFormatter/JSONDataFormatter.php b/src/DataFormatter/JSONDataFormatter.php index e5ce165..285f50f 100644 --- a/src/DataFormatter/JSONDataFormatter.php +++ b/src/DataFormatter/JSONDataFormatter.php @@ -3,12 +3,12 @@ namespace SilverStripe\RestfulServer\DataFormatter; use SilverStripe\RestfulServer\RestfulServer; -use SilverStripe\View\ArrayData; +use SilverStripe\Model\ArrayData; use SilverStripe\Core\Convert; use SilverStripe\RestfulServer\DataFormatter; use SilverStripe\ORM\DataObjectInterface; use SilverStripe\Control\Director; -use SilverStripe\ORM\SS_List; +use SilverStripe\Model\List\SS_List; use SilverStripe\ORM\FieldType; /** diff --git a/src/DataFormatter/XMLDataFormatter.php b/src/DataFormatter/XMLDataFormatter.php index 6077817..63dfa46 100644 --- a/src/DataFormatter/XMLDataFormatter.php +++ b/src/DataFormatter/XMLDataFormatter.php @@ -10,7 +10,7 @@ use SilverStripe\RestfulServer\DataFormatter; use SilverStripe\ORM\DataObject; use SilverStripe\ORM\DataObjectInterface; use SilverStripe\Control\Director; -use SilverStripe\ORM\SS_List; +use SilverStripe\Model\List\SS_List; use SilverStripe\RestfulServer\RestfulServer; use InvalidArgumentException; diff --git a/src/RestfulServer.php b/src/RestfulServer.php index 4f94f03..6d1c730 100644 --- a/src/RestfulServer.php +++ b/src/RestfulServer.php @@ -8,12 +8,12 @@ use SilverStripe\Control\Director; use SilverStripe\Control\HTTPRequest; use SilverStripe\Core\Config\Config; use SilverStripe\Core\Injector\Injector; -use SilverStripe\ORM\ArrayList; +use SilverStripe\Model\List\ArrayList; use SilverStripe\ORM\DataList; use SilverStripe\ORM\DataObject; -use SilverStripe\ORM\SS_List; -use SilverStripe\ORM\ValidationException; -use SilverStripe\ORM\ValidationResult; +use SilverStripe\Model\List\SS_List; +use SilverStripe\Core\Validation\ValidationException; +use SilverStripe\Core\Validation\ValidationResult; use SilverStripe\Security\Member; use SilverStripe\Security\Security; diff --git a/src/RestfulServerItem.php b/src/RestfulServerItem.php index 1430b7d..cffb504 100644 --- a/src/RestfulServerItem.php +++ b/src/RestfulServerItem.php @@ -2,7 +2,7 @@ namespace SilverStripe\RestfulServer; -use SilverStripe\ORM\SS_List; +use SilverStripe\Model\List\SS_List; /** * Restful server handler for a single DataObject diff --git a/tests/unit/RestfulServerTest.php b/tests/unit/RestfulServerTest.php index 154c66d..42b8795 100644 --- a/tests/unit/RestfulServerTest.php +++ b/tests/unit/RestfulServerTest.php @@ -20,6 +20,7 @@ use SilverStripe\Dev\SapphireTest; use SilverStripe\RestfulServer\DataFormatter\JSONDataFormatter; use Page; use SilverStripe\Core\Config\Config; +use SilverStripe\Core\Validation\ValidationException; use SilverStripe\RestfulServer\DataFormatter\XMLDataFormatter; class RestfulServerTest extends SapphireTest @@ -204,7 +205,7 @@ class RestfulServerTest extends SapphireTest $url = "{$this->baseURI}/api/v1/$urlSafeClassname/" . $author4->ID . '/RelatedAuthors'; $response = Director::test($url, null, null, 'GET'); $this->assertEquals(200, $response->getStatusCode()); - + $formatter = new XMLDataFormatter(); $arr = $formatter->convertStringToArray($response->getBody()); $xmlSafeClassName = $this->urlSafeClassname(RestfulServerTestAuthor::class); @@ -747,7 +748,7 @@ class RestfulServerTest extends SapphireTest // Assumption: XML is default output $formatter = new XMLDataFormatter(); $responseArr = $formatter->convertStringToArray($response->getBody()); - $this->assertEquals('SilverStripe\\ORM\\ValidationException', $responseArr['type']); + $this->assertEquals(ValidationException::class, $responseArr['type']); } public function testExceptionThrownWithPOST() diff --git a/tests/unit/Stubs/RestfulServerTestValidationFailure.php b/tests/unit/Stubs/RestfulServerTestValidationFailure.php index eedbf96..d850c8c 100644 --- a/tests/unit/Stubs/RestfulServerTestValidationFailure.php +++ b/tests/unit/Stubs/RestfulServerTestValidationFailure.php @@ -24,7 +24,7 @@ class RestfulServerTestValidationFailure extends DataObject implements TestOnly ); /** - * @return \SilverStripe\ORM\ValidationResult + * @return \SilverStripe\Core\Validation\ValidationResult */ public function validate() {