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
#20 tour-1979004-20.patch1.03 KBParisLiakos
PASSED: [[SimpleTest]]: [MySQL] 56,210 pass(es).
[ View ]
#16 tour-1979004-16.patch1.03 KBtim.plunkett
PASSED: [[SimpleTest]]: [MySQL] 55,816 pass(es).
[ View ]
#7 tour_test_controller-1979004-7.patch3.84 KBplopesc
PASSED: [[SimpleTest]]: [MySQL] 55,290 pass(es).
[ View ]
#5 tour_test_controller-1979004-5.patch3.83 KBplopesc
PASSED: [[SimpleTest]]: [MySQL] 55,337 pass(es).
[ View ]
#3 tour_test_controller-1979004-3.patch4.11 KBplopesc
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch tour_test_controller-1979004-3.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#1 tour_test_controller-1979004.patch3.93 KBplopesc
PASSED: [[SimpleTest]]: [MySQL] 55,269 pass(es).
[ View ]

Comments

Status:Active» Needs review
StatusFileSize
new3.93 KB
PASSED: [[SimpleTest]]: [MySQL] 55,269 pass(es).
[ View ]

Hello
Attaching patch that convert tour_test_1() and tour_test_2() #1979010: Convert tour_test_2() to a Controller to a Controller.
Regards

This looks basically perfect.

+++ b/core/modules/tour/tests/tour_test/lib/Drupal/tour_test/Controller/TourTestController.phpundefined
@@ -0,0 +1,66 @@
+  /**
+   * Constructs a TourTestController object.
+   */
+  public function __construct() {
+  }

If we don't inject anything there is no need for a constructor.

StatusFileSize
new4.11 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch tour_test_controller-1979004-3.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Re-rolling patch

Status:Needs review» Needs work

The last submitted patch, tour_test_controller-1979004-3.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new3.83 KB
PASSED: [[SimpleTest]]: [MySQL] 55,337 pass(es).
[ View ]

Re-rolling patch excluding .swp files

Sorry

+++ b/core/modules/tour/tests/tour_test/lib/Drupal/tour_test/Controller/TourTestController.phpundefined
@@ -0,0 +1,60 @@
+* Controller routines for tour_test routes.
+*/

needs indentation, sorry I should have spotted this the first time.

StatusFileSize
new3.84 KB
PASSED: [[SimpleTest]]: [MySQL] 55,290 pass(es).
[ View ]

No worries
Re-rolled.

Status:Needs review» Needs work
Issue tags:-WSCCI-conversion

The last submitted patch, tour_test_controller-1979004-7.patch, failed testing.

Status:Needs work» Needs review

#7: tour_test_controller-1979004-7.patch queued for re-testing.

Status:Needs review» Needs work
Issue tags:+WSCCI-conversion

The last submitted patch, tour_test_controller-1979004-7.patch, failed testing.

Status:Needs work» Needs review

I can't figure why tests are failing now. Diff between patch in #5 and #7 are only comment indentations.

Moreover, test fail comes from an unrelated project, I think.

Maybe the failing test is related to one of the last commits.

Regards.

#7: tour_test_controller-1979004-7.patch queued for re-testing.

After problems with test bot, this patch is green :)

@dawehner: Could be marked as RTBC now?

Regards

Status:Needs review» Reviewed & tested by the community

Great!

Status:Reviewed & tested by the community» Fixed

Committed and pushed 6df1d3a and pushed to 8.x. Thanks!

Status:Fixed» Needs review
StatusFileSize
new1.03 KB
PASSED: [[SimpleTest]]: [MySQL] 55,816 pass(es).
[ View ]

+++ b/core/modules/tour/tests/tour_test/lib/Drupal/tour_test/Controller/TourTestController.phpundefined
@@ -0,0 +1,60 @@
+use Drupal\Core\ControllerInterface;
+use Symfony\Component\DependencyInjection\ContainerInterface;
...
+class TourTestController implements ControllerInterface {
...
+  /**
+   * {@inheritdoc}
+   */
+  public static function create(ContainerInterface $container) {
+    return new static();

This is unnecessary and vaguely confusing. We should avoid doing this in the future.

Status:Needs review» Reviewed & tested by the community

agreed

oops

+++ b/core/modules/tour/tests/tour_test/lib/Drupal/tour_test/Controller/TourTestController.phpundefined
@@ -6,20 +7,10 @@
+ * Retursn responses for tour_test routes.

returns?

Status:Reviewed & tested by the community» Needs work

Let's fix the typo...

Status:Needs work» Reviewed & tested by the community
StatusFileSize
new1.03 KB
PASSED: [[SimpleTest]]: [MySQL] 56,210 pass(es).
[ View ]

sure quickly manually edited the patch

Status:Reviewed & tested by the community» Needs work
Issue tags:-WSCCI-conversion

The last submitted patch, tour-1979004-20.patch, failed testing.

Status:Needs work» Needs review
Issue tags:+WSCCI-conversion

#20: tour-1979004-20.patch queued for re-testing.

Title:Convert tour_test_1() to a ControllerFollowup: Convert tour_test_1() to a Controller
Status:Needs review» Reviewed & tested by the community

it was a random failure:P
i think i can rtbc it, if i just have fixed a typo right?:P

Title:Followup: Convert tour_test_1() to a ControllerConvert tour_test_1() to a Controller
Status:Reviewed & tested by the community» Fixed

After some talk with @msonnabaum and @Crell, we're just going to let these happen. It's of course rather silly for a test controller, but it is useful for real ones in case something ever needs to be injected.

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

Issue summary:View changes

Added link to META task