Commit 8ca26dcf authored by webchick's avatar webchick

Issue #1875118 by damiankloip, tim.plunkett: Move resource plugins to correct modules.

parent 21fc02cf
......@@ -5,11 +5,11 @@
* Definition of Drupal\rest\Plugin\rest\resource\DBLogResource.
*/
namespace Drupal\rest\Plugin\rest\resource;
namespace Drupal\dblog\Plugin\rest\resource;
use Drupal\rest\Plugin\ResourceBase;
use Drupal\rest\ResourceResponse;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
/**
......@@ -25,17 +25,6 @@
*/
class DBLogResource extends ResourceBase {
/**
* Overrides \Drupal\rest\Plugin\ResourceBase::routes().
*/
public function routes() {
// Only expose routes if the dblog module is enabled.
if (\Drupal::moduleHandler()->moduleExists('dblog')) {
return parent::routes();
}
return new RouteCollection();
}
/**
* Responds to GET requests.
*
......@@ -53,7 +42,10 @@ public function get($id = NULL) {
if (!empty($record)) {
return new ResourceResponse($record);
}
throw new NotFoundHttpException(t('Log entry with ID @id was not found', array('@id' => $id)));
}
throw new NotFoundHttpException(t('Log entry with ID @id was not found', array('@id' => $id)));
throw new HttpException(t('No log entry ID was provided'));
}
}
......@@ -5,22 +5,22 @@
* Definition of Drupal\rest\test\DBLogTest.
*/
namespace Drupal\rest\Tests;
namespace Drupal\dblog\Tests\Rest;
use Drupal\Component\Serialization\Json;
use Drupal\rest\Tests\RESTTestBase;
/**
* Tests the Watchdog resource to retrieve log messages.
* Tests the Watchdog REST resource to retrieve log messages.
*/
class DBLogTest extends RESTTestBase {
class DbLogResourceTest extends RESTTestBase {
/**
* Modules to enable.
*
* @var array
*/
public static $modules = array('hal', 'rest', 'dblog');
public static $modules = array('hal', 'dblog');
public static function getInfo() {
return array(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment