Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
simpletest.module
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
1 Sep 2015 at 16:13 UTC
Updated:
23 Sep 2015 at 06:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
fabianx commentedThanks for creating the issue!
Just saying: assert() is overall a pure joy to use.
Comment #3
stefan.r commentedBoth of these should fail...
Comment #5
dawehnerI think the only hope for assert() is that more people are using it, so php will not treat it as second level thing any longer.
Comment #7
valthebaldis not failing with default PHP install in Debian stable (Apache 2.4.10 module, PHP 5.6.12)
What exactly is failing PHP 5 version?
Comment #8
fabianx commented5.5.9 on Ubuntu LTS
Here is the problem:
https://3v4l.org/bpunR
It is just a warning, but phpunit really does not like warnings during tests.
Comment #9
Aki Tendo commentedAdjusted handler to have default arguments, adjusted SimpleTestTest to assert with and without a message. Thanks Fabianx.
(If this passes, minor error in patch - I am still confusing insure/ensure in my comments. I don't know why.)
Comment #10
stefan.r commentedIdeally we'd want a test only patch that triggers the warning as well, but maybe this depends on PHP versions and PHP on testbots doesnt care...
Comment #11
Aki Tendo commentedNo we don't. That warning is a mishandling of the error state and just confuses the issue. The handler should not ever return an argument error just because the assertion writer failed to include an assertion message.
I am testing that scenario now - assert without a message - but that shouldn't cause PHP to have a warning - it should just work. I'm also testing the prior scenario - assert with a message - as well.
Comment #12
stefan.r commentedWell as we can't replicate the failure but Fabianx did so manually (and got rid of it in manual testing through essentially the fix in this patch) I think this patch looks great then now. It merely adds default arguments to the exception class. I'd RTBC but I've already posted a patch :)
I do wonder if it's a major considering we can't reproduce. But it's a followup to a major so this should be good for the beta.
Comment #13
fabianx commentedThis is simple enough to RTBC:
Fail:
https://3v4l.org/bpunR
Pass:
https://3v4l.org/MjoBX
=> Works.
Comment #14
tim.plunketts/insure/ensure, as mentioned in #9
Could be fixed on commit if needed.
Comment #16
stefan.r commentedBack to RTBC on the assumption this was an unrelated test fail:
file_put_contents(/tmp/test-file.jpg): failed to open stream: Permission deniedfile_put_contents('/tmp/test-file.jpg', '') Drupal\file\Tests\Migrate\EntityFileTest->setUp() Drupal\simpletest\TestBase->run(Array) simpletest_script_run_one_test('438', 'Drupal\file\Tests\Migrate\EntityFileTest')
Comment #18
Aki Tendo commentedRetesting just to be sure.
Comment #19
catchCommitted/pushed to 8.0.x, thanks!
Comment #21
Aki Tendo commented"Insure" should be "ensure" in the comments. Sorry about that - I thought it could be dealt with at commit time. Should I make a new patch for the typo?
Comment #22
catchI missed that.
New minor followup is great.