Updated: Comment #22

Note to committers: give mparker credit (he worked on two of the conversions):
Issue #1987870 by disasm, mparker | vijaycs85: Convert theme_test() callbacks to a new style controller.

Problem/Motivation

Convert all theme_test module callbacks to a new Controller

Proposed resolution

Remaining tasks

Reviews

#1987594: Convert _theme_test_suggestion() to a new style controller
#1987592: Convert _theme_test_alter() to a new style controller

Original report by @vijaycs85

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
#25 drupal8.theme_test.1987870-25.patch8.13 KBdisasm
PASSED: [[SimpleTest]]: [MySQL] 59,179 pass(es).
[ View ]
#25 interdiff.txt879 bytesdisasm
#19 drupal8.system-module.1987870-19.patch8.12 KBdisasm
PASSED: [[SimpleTest]]: [MySQL] 58,938 pass(es).
[ View ]
#19 interdiff.txt2.43 KBdisasm
#18 drupal8.system-module.1987870-18.patch7.56 KBdisasm
PASSED: [[SimpleTest]]: [MySQL] 58,958 pass(es).
[ View ]
#18 interdiff.txt711 bytesdisasm
#16 drupal8.system-module.1987870-16.patch7.58 KBdisasm
FAILED: [[SimpleTest]]: [MySQL] 58,892 pass(es), 0 fail(s), and 6 exception(s).
[ View ]
#16 interdiff.txt3.63 KBdisasm
#14 drupal8.theme_test.1987870-14.patch7.33 KBdisasm
FAILED: [[SimpleTest]]: [MySQL] 59,003 pass(es), 1 fail(s), and 6 exception(s).
[ View ]
#12 drupal8.theme_test.1987870-12.patch4.95 KBdisasm
FAILED: [[SimpleTest]]: [MySQL] 58,547 pass(es), 0 fail(s), and 6 exception(s).
[ View ]
#12 interdiff.txt2.03 KBdisasm
#10 drupal8.theme_test.1987870-10.patch4.57 KBdisasm
FAILED: [[SimpleTest]]: [MySQL] 58,530 pass(es), 3 fail(s), and 7 exception(s).
[ View ]
#10 interdiff.txt1.52 KBdisasm
#9 drupal8.theme_test.1987870-9.patch4.62 KBdisasm
FAILED: [[SimpleTest]]: [MySQL] Setup environment: Test cancelled by admin prior to completion.
[ View ]
#9 interdiff.txt881 bytesdisasm
#7 drupal8.theme_test.1987870-7.patch4.62 KBdisasm
FAILED: [[SimpleTest]]: [MySQL] Invalid PHP syntax in core/modules/system/tests/modules/theme_test/lib/Drupal/theme_test/ThemeTestController.php.
[ View ]
#7 interdiff.txt2.79 KBdisasm
#4 drupal8.theme_test.1987870-4.patch3.44 KBdisasm
FAILED: [[SimpleTest]]: [MySQL] 58,286 pass(es), 0 fail(s), and 6 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 theme_test_hook_init_page_callback() to a new style controllerConvert theme_test callbacks to a new style controller
Assigned:Unassigned» disasm

Status:Active» Needs review
StatusFileSize
new3.44 KB
FAILED: [[SimpleTest]]: [MySQL] 58,286 pass(es), 0 fail(s), and 6 exception(s).
[ View ]

first pass. still needs to have drupal_add_css calls converted to a render array.

Status:Needs review» Needs work

The last submitted patch, drupal8.theme_test.1987870-4.patch, failed testing.

Status:Needs work» Needs review

+++ b/core/modules/system/tests/modules/theme_test/theme_test.module
@@ -64,16 +64,6 @@ function theme_test_menu() {
-    'page callback' => 'theme_test_template_test_page_callback',
...
-    'page callback' => 'theme_test_info_stylesheets',

You should also remove the previous code.

StatusFileSize
new2.79 KB
new4.62 KB
FAILED: [[SimpleTest]]: [MySQL] Invalid PHP syntax in core/modules/system/tests/modules/theme_test/lib/Drupal/theme_test/ThemeTestController.php.
[ View ]

converting drupal_add_css to render array. removing code I forgot to delete.

Status:Needs review» Needs work

The last submitted patch, drupal8.theme_test.1987870-7.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new881 bytes
new4.62 KB
FAILED: [[SimpleTest]]: [MySQL] Setup environment: Test cancelled by admin prior to completion.
[ View ]

Apparently arrays can't be instantiated as objects with the new keyword. In other words, I messed up ;-) Here's a fix.

StatusFileSize
new1.52 KB
new4.57 KB
FAILED: [[SimpleTest]]: [MySQL] 58,530 pass(es), 3 fail(s), and 7 exception(s).
[ View ]

renaming render_array -> build.

Status:Needs review» Needs work

The last submitted patch, drupal8.theme_test.1987870-10.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new2.03 KB
new4.95 KB
FAILED: [[SimpleTest]]: [MySQL] 58,547 pass(es), 0 fail(s), and 6 exception(s).
[ View ]

actually returning the render array now instead of return some other variable that isn't set.

Status:Needs review» Needs work

The last submitted patch, drupal8.theme_test.1987870-12.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new7.33 KB
FAILED: [[SimpleTest]]: [MySQL] 59,003 pass(es), 1 fail(s), and 6 exception(s).
[ View ]

trying a combination of all three remaining theme_test callbacks.

Status:Needs review» Needs work

The last submitted patch, drupal8.theme_test.1987870-14.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new3.63 KB
new7.58 KB
FAILED: [[SimpleTest]]: [MySQL] 58,892 pass(es), 0 fail(s), and 6 exception(s).
[ View ]

try again.

Status:Needs review» Needs work

The last submitted patch, drupal8.system-module.1987870-16.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new711 bytes
new7.56 KB
PASSED: [[SimpleTest]]: [MySQL] 58,958 pass(es).
[ View ]

reverting testTemplate to return theme() to pass tests.

StatusFileSize
new2.43 KB
new8.12 KB
PASSED: [[SimpleTest]]: [MySQL] 58,938 pass(es).
[ View ]

adding the last remaining callback in that module for good measure.

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

The last submitted patch, drupal8.system-module.1987870-19.patch, failed testing.

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

Issue summary:View changes

update

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.

  1. +++ w/core/modules/system/tests/modules/theme_test/lib/Drupal/theme_test/ThemeTestController.php
    @@ -7,28 +7,88 @@
    +      return theme('theme_test_template_test');

    I am sorry ... too many whitespaces.

  2. +++ w/core/modules/system/tests/modules/theme_test/lib/Drupal/theme_test/ThemeTestController.php
    @@ -7,28 +7,88 @@
    +   * Tests themed output generated in a request listener.
    +   * @return string

    Let's put an empty line between there.

Status:Needs review» Needs work

.

Status:Needs work» Needs review
StatusFileSize
new879 bytes
new8.13 KB
PASSED: [[SimpleTest]]: [MySQL] 59,179 pass(es).
[ View ]

changes requested in #23 completed.

Status:Needs review» Reviewed & tested by the community

Thank you very much!

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

The last submitted patch, drupal8.theme_test.1987870-25.patch, failed testing.

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

#25: drupal8.theme_test.1987870-25.patch queued for re-testing.

Status:Needs review» Reviewed & tested by the community

This was just a random failure.

Status:Reviewed & tested by the community» Fixed

Committed and pushed to 8.x. Thanks!

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

Issue summary:View changes

adding related issues.