Part of #1971384: [META] Convert page callbacks to controllers

For instructions on how to convert a page callback into a controller, see the WSCCI Conversion Guide.

Files: 
CommentFileSizeAuthor
#18 drupal8.error_test.1987700-18.patch8.92 KBdisasm
PASSED: [[SimpleTest]]: [MySQL] 58,145 pass(es).
[ View ]
#18 interdiff.txt1.05 KBdisasm
#16 drupal8.error_test.1987700-16.patch9.58 KBdisasm
PASSED: [[SimpleTest]]: [MySQL] 58,532 pass(es).
[ View ]
#16 interdiff.txt940 bytesdisasm
#13 drupal8.error_test.1987700-13.patch9.74 KBdisasm
PASSED: [[SimpleTest]]: [MySQL] 58,514 pass(es).
[ View ]
#13 interdiff.txt4.78 KBdisasm
#11 drupal8.error_test.1987700-11.patch9.75 KBdisasm
FAILED: [[SimpleTest]]: [MySQL] 58,407 pass(es), 13 fail(s), and 0 exception(s).
[ View ]
#11 interdiff.txt737 bytesdisasm
#9 drupal8.error_test.1987700-9.patch9.75 KBdisasm
FAILED: [[SimpleTest]]: [MySQL] Invalid PHP syntax in core/modules/system/tests/modules/error_test/lib/Drupal/error_test/Controller/ErrorTestController.php.
[ View ]
#9 interdiff.txt5.47 KBdisasm
#7 drupal8.error_test-module.1987700-7.patch10.3 KBdisasm
PASSED: [[SimpleTest]]: [MySQL] 58,249 pass(es).
[ View ]
#7 interdiff.txt3.3 KBdisasm
#5 drupal8.error_test_conversion.1987700-5.patch9.43 KBdisasm
FAILED: [[SimpleTest]]: [MySQL] 58,112 pass(es), 1 fail(s), and 0 exception(s).
[ View ]

Comments

Status:Active» Closed (won't fix)

Need to rewrite the whole module to make test sync with current test implementation. For more details, please refer: #1988802: [META] Rewrite test modules in system to provide better unit testing.

Status:Closed (won't fix)» Active

Title:Convert error_test_generate_warnings() to a new style controllerConvert error_tes module to a new style controller
Assigned:Unassigned» disasm

Title:Convert error_tes module to a new style controllerConvert error_test module to a new style controller

Status:Active» Needs review
StatusFileSize
new9.43 KB
FAILED: [[SimpleTest]]: [MySQL] 58,112 pass(es), 1 fail(s), and 0 exception(s).
[ View ]

attached patch converts all routes in error_test module and fixes the error messages the tests are looking for.

Status:Needs review» Needs work

The last submitted patch, drupal8.error_test_conversion.1987700-5.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new3.3 KB
new10.3 KB
PASSED: [[SimpleTest]]: [MySQL] 58,249 pass(es).
[ View ]

attached patch with interdiff fixes remaining test failures.

Status:Needs review» Needs work

+++ b/core/modules/system/tests/modules/error_test/lib/Drupal/error_test/Controllers/ErrorTestController.php
@@ -0,0 +1,68 @@
+class ErrorTestController implements ControllerInterface {
...
+  /**
+   * Constructs a UpdateTestController object.
+   *
+   * @param \Drupal\Core\Config\ConfigFactory $config_factory
+   *   The factory for configuration objects.
+   */
+  public function __construct(Connection $database) {
+    $this->database = $database;
+  }

Let's simply extend the ControllerBase, so need for this boilerplate for tests.

Status:Needs work» Needs review
StatusFileSize
new5.47 KB
new9.75 KB
FAILED: [[SimpleTest]]: [MySQL] Invalid PHP syntax in core/modules/system/tests/modules/error_test/lib/Drupal/error_test/Controller/ErrorTestController.php.
[ View ]

renamed Controllers -> Controller.
Removed boilerplate in favor of $this->container->get

Status:Needs review» Needs work

The last submitted patch, drupal8.error_test.1987700-9.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new737 bytes
new9.75 KB
FAILED: [[SimpleTest]]: [MySQL] 58,407 pass(es), 13 fail(s), and 0 exception(s).
[ View ]

Attached patch fixes missing ;

Status:Needs review» Needs work

The last submitted patch, drupal8.error_test.1987700-11.patch, failed testing.

StatusFileSize
new4.78 KB
new9.74 KB
PASSED: [[SimpleTest]]: [MySQL] 58,514 pass(es).
[ View ]

Forgot error handlers were keying off of the class name. That's fixed too now.

Status:Needs work» Needs review

+++ b/core/modules/system/lib/Drupal/system/Tests/Common/SimpleTestErrorCollectorTest.php
@@ -94,6 +95,7 @@ protected function error($message = '', $group = 'Other', array $caller = NULL)
+    $this->verbose(print_r($error,TRUE));

Let's remove that :)

StatusFileSize
new940 bytes
new9.58 KB
PASSED: [[SimpleTest]]: [MySQL] 58,532 pass(es).
[ View ]

removed!

Status:Needs review» Needs work

+++ b/core/modules/system/lib/Drupal/system/Tests/Common/SimpleTestErrorCollectorTest.php
@@ -94,6 +94,7 @@ protected function error($message = '', $group = 'Other', array $caller = NULL)
+    $this->verbose(print_r($error,TRUE));

There is one more.

Status:Needs work» Needs review
StatusFileSize
new1.05 KB
new8.92 KB
PASSED: [[SimpleTest]]: [MySQL] 58,145 pass(es).
[ View ]

removed!

Status:Needs review» Reviewed & tested by the community

Quick, before core changes again. :-)

#18: drupal8.error_test.1987700-18.patch queued for re-testing.

Status:Reviewed & tested by the community» Fixed

Committed and pushed to 8.x. Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.