Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Sub-issue for meta issue #1880976: [meta] Port examples (including submodules) to D9.4+
Problem/Motivation
D8 all the things!
Proposed resolution
Start with D7 version and figure out how to port ;)
Comment | File | Size | Author |
---|---|---|---|
#105 | commit_interdiff.txt | 2.76 KB | Mile23 |
#103 | 2102651-fe-103.patch | 42.92 KB | Torenware |
| |||
#103 | interdiff-fe-11.txt | 6.67 KB | Torenware |
#97 | file-example-2102651-torenware-v12.patch | 43.63 KB | Torenware |
#97 | interdiff-fe-10.txt | 9.53 KB | Torenware |
Comments
Comment #1
fran seva CreditAttribution: fran seva commentedI'm on it :)
Comment #2
Mile23Great! Thanks. :-)
Also a friendly reminder that we have the examples module checklist: #2209627: [meta] Module Checklist for Examples
Comment #3
fran seva CreditAttribution: fran seva commented@Mile23 thanks for the link!!
Comment #4
Torenware CreditAttribution: Torenware as a volunteer commented@fran seva -- howdy! Do you mind if I grab this one?
Comment #5
Andrew.Mikhailov CreditAttribution: Andrew.Mikhailov at DrupalJedi commented@Torenware I also can help you.
Comment #6
Torenware CreditAttribution: Torenware as a volunteer commented@Andrew.Mikhailov: that'd be great.
To make things a bit easier, I've set up a github repo at https://github.com/torenware/drupal8-examples. I'll be working off the
file-example-workspace
At this point, I've set up the basic structure. I have:
The goal now is to get more and more of this implemented until the tests run green. TDD for the win!
A good thing to start with is to get the menu links set up correctly so the File Example appears in the Tools menu. This will be like the other example modules that are already done.
If you're more ambitious, then you can start working on the form class. The goal is to make it as close as possible to the original D7 code.
I'll start out working on getting the stream class working. Once that's up, I'll start looking at the form itself.
Just clone the repo, and get yourself set up.
Comment #7
Torenware CreditAttribution: Torenware as a volunteer commentedQuick progress report: I now have a bit over 1/2 of the tests working. The stuff in file.inc hasn't changed much at all, but the way D8 handles URLs broke a surprising lot of stuff.
One thing that works but is deprecated. The stream wrapper demo puts a file system over part of the $_SESSION global. This is a no-no; see Access session data through the Request object. But making the stream wrapper work using the recommended API is turning out to be pretty hard, and isn't really the point of the demo anyway. So I'm open to suggestions as to how best handle that.
I've also run into trouble trying to do something that should be easy: create a link to a non-managed file. D8 really does not want to do that. Anybody know how to work around that? This is used in the demo so you can see the contents of any files created by the demo.
I'll start looking over the portions of the tests that are failing in a bit, but the demo is already pretty usable.
Comment #8
Torenware CreditAttribution: Torenware as a volunteer commentedFirst patch. This could be "needs work" (it does), but it needs some other eyes on this at this point.
Working at this point:
Not working:
Comment #9
Torenware CreditAttribution: Torenware as a volunteer commentedI'll get the extra/lack space records on the next patch. Mostly, I'm interested in feedback on the "not working" issues.
Comment #11
Andrew.Mikhailov CreditAttribution: Andrew.Mikhailov at DrupalJedi commentedSeems I've fixed it. Also I replace deprecated functions
Added only menu I've added file *.links.menu.yml, I'm investigating how to add menu to toolbar.
I got on my local machine next result http://joxi.ru/n2Yn0Qdu3DR1A6
657 passes, 16 fails, 55 exceptions, 309 debug messages
Comment #12
Andrew.Mikhailov CreditAttribution: Andrew.Mikhailov at DrupalJedi commentedComment #15
Torenware CreditAttribution: Torenware as a volunteer commentedI'm down to 0 fails 0 exceptions on the test, so I have a fully working version.
I will look at Andrew's version in a bit. Getting the tests to pass was rather hard; I needed timplunkett help to figure out the URL issues, which were surprisingly nasty. Nastier than just about anything else :-)
I'll also supply an interdiff, since this is going to be fairly large. As before, the github link is a good quick way to see what progress looks like.
Comment #16
Torenware CreditAttribution: Torenware as a volunteer commentedI'm going to post my patch for as-of-now state. I've loaded both my version and Andrew's to the github repo, mainly because the two versions are different enough that a merge is going to take a while :-/
If someone can suggest a good graphical diffing tool, much obliged!
Comment #17
Andrew.Mikhailov CreditAttribution: Andrew.Mikhailov at DrupalJedi commentedif you use PHPstorm, you can select 2 files and press ctrl/cmd+D
Also you can use Meld http://meldmerge.org/
Best regards.
Comment #18
Torenware CreditAttribution: Torenware as a volunteer commentedOK, first pass on the merge did not go so well.
The difference between the two versions are of several kinds:
I"m done for today, and probably for most of the week. Andrew may want to compare the versions and see if he can come up with a merge that passes the tests.
Comment #19
Torenware CreditAttribution: Torenware as a volunteer commentedI've got a merged version of the example up on github.
I got in Andrew's use of the modern APIs, and the menu link. A minor exceptions to that:
Not sure how this works. It might not, since getExternalUrl works a little different in my version, and the URL related code in the stream wrapper class was changed to make it more like the stream wrapper classes in Core. In general, the URL generator is a dangerous piece of code in D8.
I'll post the full patch and an interdiff soon.
Comment #20
Torenware CreditAttribution: Torenware as a volunteer commentedI've added my latest patch, and an interdiff between Andrew's patch and my latest.
Quick notes:
getMimeType()
is no longer in Drupal's stream wrapper interface, so I removed it from the port.accessSession()
from the controller, since I ended up using Core's approach for accessing files stored in our demo stream wrapper class. Core uses\Drupal\system\FileDownloadController::download()
as the controller class to do this for private and temporary files, and I now do the same.\Drupal\Core\StreamWrapper\StreamWrapperInterface
itself is not compliant (since it's based off a non-Drupal interface).What needs to be done before we can commit this and close the issue out:
Comment #21
Torenware CreditAttribution: Torenware as a volunteer commentedComment #26
Torenware CreditAttribution: Torenware as a volunteer commentedThis is annoying.
The testbot installs to a subdirectory of DOCUMENT_ROOT. The fail seems to be due to some of my generated links not resolving due to this problem.
The SIMPLETEST-ME button works fine when I run the tests, so it's gotta be related to running from a subdirectory.
This will need fixing, if only because the URL code in the example needs to be robust against this kind of install.
Comment #27
Torenware CreditAttribution: Torenware as a volunteer commentedThis is a fun one. We run perfectly under the GUI for SimpleTest. But @timplunkett's suggestion, I tried run-test.sh. and wouldn't you know, it fails under the script. Which the testbot uses.
Not sure how that differs, but at least there's something to debug.
Comment #33
Torenware CreditAttribution: Torenware as a volunteer commentedI'm out of ideas on the test failure. I've looked it as an issue on the test bot (#2598720: Fails on testbot, works locally under subdir drupal using run-test.sh). Hopefully somebody can shed some light on this.
Comment #34
Mile23Thanks for sticking with it.
OK, so we've got some failures but they seem to be related to just one thing, and might be solvable by the testbot. It might also be that as we move forward with other things we'll find a solution.
So here's a sort of first-phase review of some obvious stuff.
We really want to describe what the module does, not where to find the code.
We also need to describe, somewhere, the difference between managed and unmanaged files.
This should say 'Implements hook_file_download().' https://www.drupal.org/coding-standards/docs#hookimpl
We'll fudge the coding standards a bit and leave the rest of the docblock.
Needs @see hook_file_download() as well.
Explain what a 'config download' is, since it's kind of the thing we're demonstrating. :-)
'See [whatever] files in the File Example module' (Like the first permission in the file)
It'd be great if we had the description content at the top of the fileapi form, and just got rid of the controller.
Explain what's happening, then explain the other option. So something like:
"We create a stream wrapper service here using tags. We could also manually add our service to 'stream_wrapper.manager'."
'Drupal 7.'
Also, like I mentioned before, fold this content into the form and remove the controller.
Hell no. :-)
We have 'session' service. Inject that if we really need the session.
Also, I think what's happening here is that we're using a session variable to pass the 'default' around. This can be replaced with a config or state. And will be. :-)
Again, inject that service.
I'm not sure if this is necessary or factored properly, but leave it for now.
Wrap at 80 chars.
DIE. :-)
Inject this service.
Kill with fire.
Comment #35
Torenware CreditAttribution: Torenware as a volunteer commented@Mile23 --
Much thanks. I'll look these over this evening.
Yeah, settings is the right thing to do for some of this.
For the rest of the session stuff, yeah, I'd love to use the session service. I tried this and had to back it out; the D7 code uses references to $_SESSION subarrays, which was easy to move around. The session service can only read an attribute and write an attribute, so I'm trying to figure out how wrap the session object in such a way that I can keep a pointer into the session. Having the tests work helps a lot for taking this on, since when I bailed on this, I was pretty far from a clean test.
Comment #36
Torenware CreditAttribution: Torenware as a volunteer commented@Mile23 --
Got a start at this. The following is done and pushed to my github staging area:
One thought; we likely put the file system over $_SESSION in D7 because it was the simplest thing you could do that would make a reasonable stream wrapper demo. Given the changes in the API for sessions in D8, it's actually the same amount of work to use the State API as it would be to manipulate the session. Doing a "State Space" stream wrapper might actually be better, since we're allowing the stream wrapper to create managed files; once a session times out, the "file" will be gone, but File Entity will persist. I'd guess that the entity manager won't be happy if we try to delete the files. So it might be neater to use State for everything, since State will stick around. Makes the demo easier to uninstall (as we probably should with this demo). Your thoughts on this?
I'll update the patch and regenerate an interdiff once I finish with the documentation changes and the rest of the items in your list.
Comment #37
Torenware CreditAttribution: Torenware as a volunteer commentedI've updated github. Just about everything that needed a doc fix is fixed. Most things that needed to get dropped (the "config download" business was an out-and-out typo) got dropped. Things that needed to be burned with fire are now a smoldering ruin, save for uses of $_SESSION that affect the session:// demo stream wrapper, since I don't have a working version that does not talk to the magic global yet.
I'll take another stab at the session abstraction stuff. Also: we can use state data instead of session data, and again, I think that may be a better solution.
Comment #38
Torenware CreditAttribution: Torenware as a volunteer commentedNear publishable version. The highlights:
The code works and runs clean. You'll probably need some changes here and there, but I think this code is at least as good as the D7 module I'm replacing.
Patch and interdiff (from my v3) enclosed.
Comment #39
Torenware CreditAttribution: Torenware as a volunteer commentedChanging status so we can wake up the testbot.
Comment #45
Torenware CreditAttribution: Torenware as a volunteer commentedLooks like the new tests need @group annotations.
Fixed with this patch, I hope.
Comment #47
Torenware CreditAttribution: Torenware as a volunteer commentedNot sure why this one failed. The Jenkins log says this:
The only difference between the testbot's environment and mine seems to be PHP version (bot's running 5.5, I'm running 5.6). I'll try to do 5.5 locally to see if I can replicate this.
Comment #48
Torenware CreditAttribution: Torenware as a volunteer commentedTried PHP 5.5. I still pass locally.
Turns out that the problem is specific to running these phpunit tests under run-tests.sh. I have a question up on Drupal Questions about this. If anyone has insight on why run-tests.sh has trouble with tests that run fine under phpunit directly, much obliged.
Comment #49
Torenware CreditAttribution: Torenware as a volunteer commented@Berdir answered the question on Drupal Answers:
This indeed fixes the problem. The testbot should be happier this time.
Comment #51
Torenware CreditAttribution: Torenware as a volunteer commentedCount me puzzled. I'm:
The PHPUnit tests run fine, but the Simpletest fails exactly as the patch from #20 failed:
The equivalent part of the script is:
The trouble occurs at the "clickLink()" line; this works outside of the bot, but not on the bot.
I need to see what's happening on the bot. I'd guess that if the server process used by the bot keeps an error log, that there's some error I need to see there. But without that, I'm completely in the dark.
I need help with the bot, for certain.
Comment #52
MixologicDid you try running this with a high concurrency? like, say, 32 like the bots run? Im wondering if this is a result of there being an unspoken dependency Intra-test and that one test relies on the fact that some things are still leftover in the session variable, which they would have entirely different session variables if accessed concurrently.
Comment #53
Torenware CreditAttribution: Torenware as a volunteer commented@Mixologic -- I'm still using the standard testbot in the output you see above. So whatever drupalci gives me when I upload the patch and set "Needs review" is what I get.
My tests are self-contained, and I'm certainly assuming that things get torn down. But the test that's giving me trouble cycles over 4 different buttons on a form, for four different kinds of stream wrapper schemes, so it's not impossible that certain things are left over.
The question here, though, is why the testbot trips over these things when doing run-tests.sh locally does not have this problem. I'm not sure how I'd figure that out.
I am getting set up with a Vagrant hosted drupalci testbot if there's anything you want me to try.
Comment #54
Mile23Thanks for all the dilligence on the testbot, @Torenware and @Mixologic. I'd wager that the fault lies in the example, not the testbot, though it'd be nice to prove it one way or another.
In the mean time, here's some review:
Can the wrapper take DI arguments or not? If it can, just use @session. If not, remove arguments here.
So since DI won't work here, let's get rid of create(), and not implement ContainerInjectionInterface.
Also, we don't need the request stack, we need the session. So in
__construct()
, just grab\Drupal::service('request_stack')->getCurrentRequest()->getSession();
Again, we don't need the request stack. Make a protected
$session
property.This should be in with the tests.
Inject the session instead of the request stack.
Since this method is protected, now we don't need it since we're going to inject the session instead of the request stack.
Really not a fan of this pattern (anti-pattern, really) where we always have a logged-in user with superpowers from
setUp()
for all tests in the test class.Either turn it into a factory method so other tests can use it, or inline it with the test method.
We can just not use
t()
in tests. It's the standard for core, and is reasonable.Comment #55
Torenware CreditAttribution: Torenware as a volunteer commentedTurns out it can't, so I've removed the injection of the argument here.
I've removed create() and the use statements this required.
As for the request stack -- yeah, we actually do need it. The session is not injectable, it turns out ( see the change record and also the issues connected with it), and the SessionManager service, if it's still in Core, is on its way out. Given the way we're manipulating the session object, we also need to do exactly as the change record does, and do the read/write on it as atomically as possible. We really can't stash it at all. So it's fetch the session data, change it, and put it directly back. The is the price of no longer being able to keep references into the $_SESSION array.
That leaves why to use RequestStack and not Request. You'll see that core always injects the former, and never the latter. The explanation is in Symfony blog (New in Symfony 2.4: The Request Stack: the Request turns out to be a flaky object, and if you want to get its correct state, you need go through RequestStack post Symfony 2.4. So if you want to talk to the session, you need to drag a RequestStack around to get at it.
Originally, MockSessionTrait.php was indeed in tests/. It had to come out, since run-tests.sh will not find traits used in PHPUnit tests unless they are in the module (and the the module's test) namespace. This I learned from @Berdir: http://drupal.stackexchange.com/questions/178831/error-running-a-phpunit....
It might be a better idea to move it into a "Utilities" directory, but yeah, it's gotta be under src/ and not tests/src.
The required superpowers are very specific to this test, so it made sense to inline it. This I did.
I totally agree. I just brought this forward from the D7 version of the example. It would have worked fine if t() still returned string and not TranslatableMarkup, but since it now does, passing the return of t() to some of the assert functions has unpredictable results. So yeah, nuke it, burn it, and hide the ashes.
A bit of background, finally, on why I'm paying all this attention to the testbot: my patches have been running clean even under pretty extreme circumstances. I was originally running my PHPUnit stuff directly under ../vendor/bin/phpunit, but found that the testbot does two things that can break phpunit tests:
So I fixed all this, and discovered that 3 asserts still fail only in the testbot. I don't have a clue why this is happening, and after @Mixologic spent an hour trying to figure it out, neither does he. Short version: retrieving the content of one of our fake "session files" via FileDownloadController::download() (which is how private:// and temporary:// work) fails only on the session:// URIs, and it fails only on the testbot. Which, well, sucks.
I'm tempted to simply remove the assert causing the trouble, since at this point, it's not at all clear why the testbot is having trouble. My personal theory is that the session is not "fetchable" on some corner cases. But without any visibility into the testbot, who the hell knows, really.
In any case: if these approaches work for you, I'll spin up another patch. I'm actually pessimistic that that testbot will pass it unless that one assert goes out of the test.
Comment #56
Torenware CreditAttribution: Torenware as a volunteer commentedLetting the testbot have another whack at it.
Comment #58
Torenware CreditAttribution: Torenware as a volunteer commentedSame testbot failure as previously: getting a 404 on retrieving session "files".
Comment #59
Torenware CreditAttribution: Torenware as a volunteer commentedTest implementation of the stream wrapper using State instead of Session. Not ready for human review (class/variable names need to change, and accompanying verbiage), but I want to see if the testbot prefers this implementation.
Comment #61
Torenware CreditAttribution: Torenware as a volunteer commentedFailure does not relate to the use of session. A clue, maybe?
Comment #62
Mile23So PHPUnit tests are supposed to have a root-level
bootstrap.php
file that all tests can use to load their special classes/traits, etc. That's true of PHPUnit in general and not just Drupal or run-tests.sh.Drupal has a bootstrap.php at tests/bootstrap.php.
That bootstrapper registers autoloading namespaces for tests it's running.
So some other piece of the implementation is broken.
But naturally the Drupal solution is to just put classes in the wrong place.
OK. Done venting. For now. :-)
As for State instead of Session: That makes the file system per-site instead of per-user, but I don't really care. :-)
I think there are some caveats around session that make it very delicate for contrib use. I was trying to figure out how to change a cookie earlier with no good luck.
Comment #63
Torenware CreditAttribution: Torenware as a volunteer commentedThat's how I read it too. My impression is that folks know this is broken, but in the scheme of things, they're letting it slide. But yeah, MockSessionTrait.php belongs in the test/src hierarchy. It would be, like the NORMAL thing that it would work from there :-)
So, yeah, hear your rant, call it. Might even raise it.
The state test indicated that our using the session was not the reason the bot decided to hate on me. So I've got another votive offering for the bot. If it passes (it might even, based on some things I changed), then I'll put up an official patch.
If we did want to use a State based implementation, the main virtue is that the demo creates managed files, which live longer than the SESSION that backs them. If we used State, then you wouldn't have the file entity definitions outlive the file data. But that's minor. If we wanted to do it, it's a pretty simple change to what we have already, since the SessionWrapper stuff works as well for State as it does for Session.
So I'm throwing one more
shrimppatch on the barbee. Let's see if this mofo does what it needs to do. If it does, then, well, halleluyah.Comment #64
Torenware CreditAttribution: Torenware as a volunteer commentedWell, look at that. Damn thing's running green.
Official patch and interdiff.
Main change was discovering that Core uses
slight of handpath processors to make its menu-tail type paths work. I now do the same. Also, I eliminated a warning related to chmod(); turns out that the stream wrapper needs to do things a little differently than I thought.Some doc changes as well to explain this stuff.
Comment #65
Torenware CreditAttribution: Torenware as a volunteer commentedOK, I've pleased the Robot God, and we have a working patch.
Passing the damn bot probably introduced a bit more complexity, but the extra stuff is both useful and under-documented. If anyone's explained how to do menu-tails in D8, I haven't seen it.
Comment #66
Torenware CreditAttribution: Torenware as a volunteer commentedAfter some thought, an idea as to how to handle this issue.
The File API itself is fairly simple, and I think the file_example module should be relatively simple. The complexity in this patch mostly relates to the stream wrapper, which is a lot harder to do in D8 than it was in D7. But there really isn't that much of a dependency between the stream wrapper related stuff and the rest of the module.
What might work here is to split the patch into two separate example modules, file_example and stream_wrapper_example. I'd do it like this:
Stream wrappers are an advanced topic anyway, so we push the complexity into the advanced example, and leave the file_example clean and simple.
I'd keep both modules under this patch, since I think the FileExampleTest is a good torture test of the stream wrapper code, and we want the two modules to be built to work well with each other.
Comment #67
Torenware CreditAttribution: Torenware as a volunteer commentedAlthough I made a bit of progress on that store: see #2605664: [Needs change record updates] Align TestDiscovery and bootstrap.php's non-permissive loading of PSR-4 namespaces for traits. This might even get in for 8.0.0.
Comment #69
Torenware CreditAttribution: Torenware as a volunteer commentedLooks like there were !placeholders in the example. These are now removed.
Comment #71
Mile23So are we still considering splitting out to two modules?
Comment #72
Torenware CreditAttribution: Torenware as a volunteer commented@Mile23 -- your call. It probably makes sense, since the stream class is high tech, and file operations should be more accessible.
In any case, looks like I'll need to see why the tests are no longer testing. E*U((#@ Deja Vu All Over Again.
Comment #73
Torenware CreditAttribution: Torenware as a volunteer commentedFirst, I need to get this working again.
Turns out the problem was due to a change recorded as Many methods for generating URLs and links deprecated; EntityInterface::toUrl() and EntityInterface::toLink() added. This broke both the URL building code and the t() statements that built the embedded links.
New code here doesn't trust the standard routines to do the right thing, 'cause they don't: the remaining URL creation APIs are not stream wrapper aware. The solution is to use the StreamWrapperManager to get at the external URL building code in that interface, which is probably what Core should do, but does not. This works, and is simpler than my previous code as well.
It is also no longer possible to use LinkGeneratorTrait::l() to embed a link in a localizable string. I will not rant about this
BUT I MUST!! I MUST!!!Read the relevant issues attached to the CR, and well, weep. I do things according to the CR, but I doth protest.New patch and interdiff uploaded. I'll start separating this into two example modules once the combined module passes ROBOT DEATH MATCH.
Comment #74
Torenware CreditAttribution: Torenware as a volunteer commentedComment #87
Torenware CreditAttribution: Torenware as a volunteer commentedI'm transferring work between laptops; looks like I reused my patch numbers. Not to worry; the lastest path #9 works.
Comment #88
Torenware CreditAttribution: Torenware as a volunteer commentedComment #89
Torenware CreditAttribution: Torenware as a volunteer commentedFirst working version split into the File Example and Stream Wrapper Example modules. This is a good time to get some feedback on the work.
Comment #90
Mile23Thanks for splitting them out.
Since they don't seem to be dependent on each other, let's make a separate issue for the stream wrapper example. Here's a patch with only file_example.
Comment #92
Mile23Created #2638290: Create stream_wrapper_example
Comment #93
Torenware CreditAttribution: Torenware as a volunteer commentedI think there's currently a dependency (easy to remove) where the file example's test brings up the stream wrapper module as one of the streams it tests. I'll remove it and see if that makes the newly separated example test clean.
Also: looks like the trait loading issue is starting to get attention from Alex and the gang. Once it's in, I'll factor the stream wrapper tests accordingly.
Comment #94
Mile23Oh, if there's a dependency (and it's worth keeping) then just ignore #90.
Just make it a hard dependency in file_example's info.yml.
So I'm off in the weeds on this right now because d.o's testbot demands that we test against 8.1.x-dev. Just ignore that for now, because I think the APIs haven't changed that much.
Comment #95
Torenware CreditAttribution: Torenware as a volunteer commentedThe difference is pretty trivial; see the enclosed interdiff. Might be worth re-adding the dependency later, once streamwrapper_example lands. As is, the SWE in #2638290: Create stream_wrapper_example tests green. We can get this one green as well, and recreate the dependency as a follow-up issue, once both examples are in the tree.
Comment #96
Mile23I'd really like to have the changes in #2605664: [Needs change record updates] Align TestDiscovery and bootstrap.php's non-permissive loading of PSR-4 namespaces for traits so that we can then commit things the right way (traits for tests in the tests directory), but it looks like that has fizzled out.
Therefore let's just do the workaround, document it as a @todo, and make a follow-up to move it once the fix happens.
Re-running the test now...
Comment #97
Torenware CreditAttribution: Torenware as a volunteer commentedReviving this one in time for DrupalCon. This patch fixes most issues with drupalcs (some things it dislikes are things I want to keep), and adds the item to the Toolbar menu. The module no longer depends on the Stream Wrapper Example, but the form will use the "session" wrapper if that module is activated.
Comment #99
Torenware CreditAttribution: Torenware as a volunteer commentedThis appears to have failed because we're testing along with the rest of Example; #2690403: Fatal error: Class 'Drupal\field\Tests\FieldUnitTestBase' not found.
I'm going to try to test w/o the upstream integration. Is there any way to do that?
Comment #100
Torenware CreditAttribution: Torenware as a volunteer commentedThis appears to be the issue from #2690403: Fatal error: Class 'Drupal\field\Tests\FieldUnitTestBase' not found. Looks like we can fix that, which will fix this.
Comment #101
navneet0693 CreditAttribution: navneet0693 as a volunteer and at QED42 commentedHi @Torenware,
As mentioned by @Mile23 on #2661834: Core uses hyphen for paths, not underscores, I have added a test against Drupal 8.1.x which results as Pass.
Tested functionality on local, everything is working fine.
Review Results : Pass
Drupal : 8.1.0
MySQL : 5.5.42
PHP : 5.6.10
Comment #102
Mile23Whew. Man we need to get this out the door.
Still a few items to address, mostly relating to coding standards, but also some code stuff.
I think if we can get these changes we can then get it released and file follow-ups if there are any.
Needs to wrap at 80 chars.
Should be 'Implements hook_file_download().'
https://www.drupal.org/coding-standards/docs#hookimpl
Too much whitespace.
New coding standards: Don't use @file for 'contains' if there's a namespace declaration.
https://www.drupal.org/coding-standards/docs#file
Should be one blank line.
Put all these arguments on their own line.
Too many * as a consequence of copypaste.
Turn this into @todo so we see it later.
We don't seem to be enabling stream_wrapper_example in this test. Fix the docs.
file_example
should declare its dependency onfile
, and then this test should just declare a dependency onfile_example
.We never use
$priviledgedUser
outside oftestFileExampleBasic()
, and it's a local variable there. Remove this property.No-op. Remove.
Comment #103
Torenware CreditAttribution: Torenware as a volunteer commentedLet's see if this does the trick here.
Comment #105
Mile23Does the trick ftmp. :-)
I did some coding standards changes, and turned the stream_wrapper_example part of the form element into a @todo.
See attached interdiff.
Huge thanks to @Torenware for being patient and getting it done.