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

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
disasm’s picture

Title: Convert theme_test_hook_init_page_callback() to a new style controller » Convert theme_test callbacks to a new style controller
Assigned: Unassigned » disasm
disasm’s picture

Status: Active » Needs review
FileSize
3.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.

dawehner’s picture

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.

disasm’s picture

FileSize
2.79 KB
4.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.

disasm’s picture

Status: Needs work » Needs review
FileSize
881 bytes
4.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.

disasm’s picture

FileSize
1.52 KB
4.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.

disasm’s picture

Status: Needs work » Needs review
FileSize
2.03 KB
4.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.

disasm’s picture

Status: Needs work » Needs review
FileSize
7.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.

disasm’s picture

Status: Needs work » Needs review
FileSize
3.63 KB
7.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.

disasm’s picture

Status: Needs work » Needs review
FileSize
711 bytes
7.56 KB
PASSED: [[SimpleTest]]: [MySQL] 58,958 pass(es). View

reverting testTemplate to return theme() to pass tests.

disasm’s picture

FileSize
2.43 KB
8.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.

disasm’s picture

Status: Needs work » Needs review
Issue tags: +WSCCI-conversion
disasm’s picture

Issue summary: View changes

update

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.

dawehner’s picture

  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.

dawehner’s picture

Status: Needs review » Needs work

.

disasm’s picture

Status: Needs work » Needs review
FileSize
879 bytes
8.13 KB
PASSED: [[SimpleTest]]: [MySQL] 59,179 pass(es). View

changes requested in #23 completed.

dawehner’s picture

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.

disasm’s picture

Status: Needs work » Needs review
Issue tags: +WSCCI-conversion
dawehner’s picture

Status: Needs review » Reviewed & tested by the community

This was just a random failure.

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.

Anonymous’s picture

Issue summary: View changes

adding related issues.