I'm opening a new issue for this because it's going to require experimenting with the testbot and some time to build a set of tests. Feel free to contribute!

Comments

TR created an issue. See original summary.

tr’s picture

StatusFileSize
new2.29 KB

Patch.

Status: Needs review » Needs work

The last submitted patch, 2: 3128807-2-mimemail-example-test-only.patch, failed testing. View results

imclean’s picture

Just a note that I was receiving a 404 error from Apache on my local development environment for all paths starting with "/example". The request wasn't even getting to Drupal.

Apache's "MultiView" was enabled by default. Removing "Multiview" from the VirtualHost resolved the problem.

tr’s picture

Interesting. The /example/mimemail_example path was copied directly from the D7 version, but I was thinking about changing that and putting it under /admin because that would be more consistent with how we usually do things in Drupal and because then the page would inherit admin access permissions. I might as well try that and see if it makes a difference with the test, as I still can not see anything wrong with the test code (and the modules + tests work for me locally too).

imclean’s picture

I tested it with a path of /admin/config/system/mimemail/mimemail_example which worked and helped me narrow down the problem.

tr’s picture

Status: Needs work » Needs review
StatusFileSize
new3.84 KB

/admin/config/system/mimemail/mimemail_example seems reasonable to me. I also added a link into .info.yml so this form can be found. Let's see if this works ...

tr’s picture

Wow, I'm amazed that worked. So the problem was using a path that began with "/example". That's definitely a bug with whatever testing environment is set up by DrupalCI - I'll work on getting that reported and fixed, or at the very least documented.

Thanks @imclean, I don't think I would have figured that out by myself anytime in the near future.

imclean’s picture

Interesting. I wonder what the testing environment entails. There's some commentary regarding MultiViews and Drupal but I haven't read much of it.

I mistyped, it's actually "MultiViews".

tr’s picture

Here's a patch where I changed 'example/mimemail_example' to 'elpmaxe/mimemail_example'. I expect this to work if the problem is because of the "example" path.

tr’s picture

Yeah, so this is definitely something about the use of /example in the path.

The tests work when the path is defined to be /elpmaxe/mimemail_example but fail with /example/mimemail_example - everything else is the same.

tr’s picture

Exact same patch as #2 but with path is defined to be /elpmaxe/mimemail_example instead of /example/mimemail_example

tr’s picture

Trying with /subdirectory instead of /example or /elpmaxe ...

Status: Needs review » Needs work

The last submitted patch, 13: 3128807-13-mimemail-example-test-only.patch, failed testing. View results

tr’s picture

Status: Needs work » Needs review
StatusFileSize
new3 KB

OK, here's the final patch to add the test case. Back to using /admin/config/system/mimemail/mimemail_example

  • TR committed d5679d0 on 8.x-1.x
    Issue #3128807 by TR, imclean: Add tests for the mimemail_example module
    
tr’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

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