Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
entity system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Mar 2015 at 15:45 UTC
Updated:
27 Mar 2015 at 15:34 UTC
Jump to comment: Most recent, Most recent file

Comments
Comment #1
arla commentedOh... and the word "not" is missing from the message ;)
Comment #2
arla commentedComment #3
miro_dietikerYeah, looks good. Although... No test coverage for this situation? ;-)
Comment #4
berdirI like the missing not ;)
We already have ContentEntityBaseTest::testIsNewRevision(), shouldn't be too hard to have a version of that method that results in throwing that exception.
Comment #5
arla commentedThanks. Here's a test.
Comment #6
arla commentedThe PHPUnit annotation @expectedExceptionMessageRegExp uses preg_match(), where \w includes "any letter or digit or the underscore character" (Escape sequences), so it fails if the placeholder is not replaced.
But still, checking for the exact message is more strict so here's that.
Comment #7
arla commentedUsing setExpectedException to do the same thing but nicer.
Comment #8
arla commentedTests-only patch, for the sake of completion.
Comment #10
arla commentedComment #11
berdirThanks.
Comment #12
alexpottThis issue is a normal bug fix, and doesn't include any disruptive changes, so it is allowed per https://www.drupal.org/core/beta-changes. Committed 5fe56e2 and pushed to 8.0.x. Thanks!