Support from Acquia helps fund testing for Drupal Acquia logo

Comments

vijaycs85’s picture

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.

ayelet_Cr’s picture

Status: Closed (won't fix) » Active
mparker17’s picture

Assigned: Unassigned » mparker17

I'll help!

mparker17’s picture

Assigned: mparker17 » Unassigned
Status: Active » Needs review
FileSize
2.8 KB

Try this...

dawehner’s picture

  1. +++ b/core/modules/system/tests/modules/common_test/lib/Drupal/common_test/Controller/CommonTestTextController.php
    @@ -0,0 +1,26 @@
    +   * Prints a destination query parameter.
    

    Let's also put a @return statement in there.

  2. +++ b/core/modules/system/tests/modules/common_test/lib/Drupal/common_test/Controller/CommonTestTextController.php
    @@ -0,0 +1,26 @@
    +    $destination = drupal_get_destination();
    +    $output = "The destination: " . check_plain($destination['destination']);
    

    check_plain can be replaced by String::checkPlain()

dawehner’s picture

Status: Needs review » Needs work
  1. +++ b/core/modules/system/tests/modules/common_test/lib/Drupal/common_test/Controller/CommonTestTextController.php
    @@ -0,0 +1,26 @@
    +   * Prints a destination query parameter.
    

    Let's also put a @return statement in there.

  2. +++ b/core/modules/system/tests/modules/common_test/lib/Drupal/common_test/Controller/CommonTestTextController.php
    @@ -0,0 +1,26 @@
    +    $destination = drupal_get_destination();
    +    $output = "The destination: " . check_plain($destination['destination']);
    

    check_plain can be replaced by String::checkPlain()

mparker17’s picture

Status: Needs work » Needs review
FileSize
1.15 KB
2.96 KB

Try this...

dawehner’s picture

  1. +++ b/core/modules/system/tests/modules/common_test/common_test.routing.yml
    @@ -4,3 +4,9 @@ common_test_l_active_class:
    +  pattern: 'common-test/destination'
    

    Sorry, but pattern should start with "/"

  2. +++ b/core/modules/system/tests/modules/common_test/lib/Drupal/common_test/Controller/CommonTestTextController.php
    @@ -0,0 +1,31 @@
    +   * @return Response
    

    ... these parameters should be absolute, so \Symfony\Component\HttpFoundation\Response ...

mparker17’s picture

Status: Needs review » Needs work

K

xjm’s picture

Thanks for your work on this issue! Please see #1971384-43: [META] Convert page callbacks to controllers for an update on the routing system conversion process.

mparker17’s picture

Status: Needs work » Needs review
FileSize
1.39 KB
3 KB

Try this...

dawehner’s picture

+++ b/core/modules/system/tests/modules/common_test/lib/Drupal/common_test/Controller/CommonTestTextController.php
@@ -0,0 +1,31 @@
+   * @return Symfony\Component\HttpFoundation\Response

Missing trailing "\" in the @return statement.

The rest looks perfect!

mparker17’s picture

Trailing slash or leading slash? :)

mparker17’s picture

Try this instead...

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

The last submitted patch, drupal8.system-module.1987644-14.patch, failed testing.

mparker17’s picture

Status: Needs work » Needs review

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

The last submitted patch, drupal8.system-module.1987644-14.patch, failed testing.

mparker17’s picture

Status: Needs work » Needs review
FileSize
3.12 KB

Straight re-roll of the patch...

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

That is fine ... even we should rather convert drupal_get_destination() to something else, but yeah this is a follow up.

webchick’s picture

Status: Reviewed & tested by the community » Needs work

Sorry, no longer applies.

dawehner’s picture

Status: Needs work » Needs review
FileSize
3.09 KB

Let's move the function into the existing controller.

mparker17’s picture

Status: Needs review » Reviewed & tested by the community

Hey @dawehner,

I had put this into a different controller based on a conversation with @Crell at the Midwest Drupal Developer Summit, where we decided it would be helpful to have separate controller objects for different return types.

However, I don't think it's worth holding up the patch for that... I really want to see the old routing system gone!

The code looks good.
The tests pass.
Manual testing works.

Looks RTBC! Thanks for all your help!

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x. Thanks!

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