With patch
Drupal test run
---------------
Tests to be run:
- Node and user token replacement (Drupal\system\Tests\System\TokenReplaceTest)
- Token replacement unit test (Drupal\system\Tests\System\TokenReplaceUnitTest)
Test run started:
Monday, January 21, 2013 - 23:20
Test summary
------------
Node and user token replacement 6 passes, 0 fails, and 0 exceptions
Token replacement unit test 30 passes, 0 fails, and 0 exceptions
Test run duration: 6 sec
real 0m6.435s
user 0m5.087s
sys 0m0.352s
without patch
Drupal test run
---------------
Tests to be run:
- Token replacement (Drupal\system\Tests\System\TokenReplaceTest)
Test run started:
Monday, January 21, 2013 - 23:22
Test summary
------------
Token replacement 36 passes, 0 fails, and 0 exceptions
Test run duration: 19 sec
real 0m20.438s
user 0m16.275s
sys 0m0.930s
| Comment | File | Size | Author |
|---|---|---|---|
| #30 | 1895018-29-interdiff.txt | 1.75 KB | berdir |
| #30 | 1895018-29.patch | 24.26 KB | berdir |
| #28 | 1895018-28-interdiff.txt | 2.35 KB | berdir |
| #28 | 1895018-28.patch | 24.22 KB | berdir |
| #25 | 1895018.patch | 23.99 KB | ceardach |
Comments
Comment #1
alexpottGo bot...
Comment #2
sunComment #3
berdirThis should now use $this->installConfig()
Comment #4
berdirRe-roll.
Comment #5
berdir#4: token-unit-test-1895018-4.patch queued for re-testing.
Comment #7
berdirRe-roll. We have separate tests for nodes and users, so I converted the useful parts over (clear option, sanitize) and dropped the other test)
Should also be easy to extract a base class for token tests and convert all the other token tests to DUBT.
Before
After
Comment #8
dawehnerThis should have a visilbity
It is good to not test all kind of tokens but just the ones which take care that the generic functionality is ensured.
At least here where code is not really moved let's replace check_plain/config/filter_xss_admin
OT: Sadly < blink > got removed from firefox.
Comment #9
berdirHad some more fun with this. Changed to use methods, config factory, function visibility, extracted a base class and also converted the node token replace tests to DUBT. Most of the others are a bit ugly and rely on web helper methods to create comments, terms, upload files and all kinds of crazyness.
Comment #11
berdir#9: token-unit-test-1895018-9.patch queued for re-testing.
Comment #12
berdirUpdating title.
Comment #13
berdirRe-roll. #2026339: Remove text_sanitize() since we have TextProcessed as an EntityNG computed property will conflict with this one again but less ugly, just applies the same change for the processed field.
Comment #15
steveoliver commentedComment #16
berdirNeeds a reroll
Comment #17
berdirThis should be quite easy.
Comment #18
danylevskyiComment #20
berdirYou can remove this line, then it should work.
Comment #21
berdirTagging for reroll
Comment #22
danylevskyiComment #24
berdirThe drop is always moving :)
Thanks for the re-roll, now try adding node_revision to the tables from node.module.
Comment #25
ceardach commentedAdded node_revision to the tables list. Also converted $node->getBCEntity() to merely $node since the EntityBCDecorator class has been removed.
Comment #26
dawehnerJust a couple of nitpicks found.
Time for a short advertisement: #2111349: Move format_plural to the string translation service and format_interval to the date service.
So if you don't specify the summary you end up with an empty summary? This makes sense.
Just in case you want to touch these lines, there is a service for format_date.
Let's make an empty line between here.
According to https://drupal.org/node/325974 we do now have @inheritdoc on the setUp method as well.
You could directly replace that with return \Drupal::languageManager()->getLanguage(Language::TYPE_INTERFACE);
Comment #27
ceardach commentedComment #28
berdirRe-rolled, using format() and formatInterval() of the date service. That one seems important enough to deserve a Drupal::date() method...
Comment #30
berdirVariable naming fail.
Comment #31
sunAwesome - RTBC it it comes back green.
Comment #32
alexpottCommitted 3274283 and pushed to 8.x. Thanks!
Comment #34
yesct commentedWe are finding the $languageInterface property name confusing. This issue changed $language_interface to languageInterface in some places, and looking at the patch here, it added:
it seems like it's really the interface language (not a LanguageInterface).
So we have the issue: #2270339: $languageInterface is a misleading variable name in TokenReplaceUnitTestBase
Feedback there would be helpful on the new name.