Message of the day:
Welcome to Silverstripe | Current release: https://www.silverstripe.org/download | Community Forum: https://forum.silverstripe.org | Feature requests: https://forum.silverstripe.org/c/feature-ideas
If you have any SilverStripe related questions, please supply the version of Framework you're using.
Did you flush? 🚽 =
I don't have framework tests installed here 😐
@wmk tks for the tips; i'm on branch 4, looks the same and current as the repo. Some tests that are failing (e.g. #8) doesn't entail an unique string though. Could u verify the output of .\vendor\bin\phpunit .\vendor\silverstripe\framework\tests\php\View\RequirementsTest.php on your setup just for my reference? branch 4, thanks!
or you're just on the wrong branch and run outdated tests that got fixed in the meantime?
@cwc I see you're testing on a WAMP installation, maybe the part of adding a unique string is different on windows and linux/unix and therefor the tests fail? Can you run the tests on a linux vm?
@robbieaverill need help getting the basic unit test to work; installed via: composer create-project --keep-vcs --dev silverstripe/installer ./ 4.x-dev --prefer-source and followed up with: .\vendor\bin\phpunit .\vendor\silverstripe\framework\tests\php\View\RequirementsTest.php This then resulted in 10 failures. This is out-of-box without any modifications, without even running the installer from browser (I had tried on another installation with browser installer completed and the same failures occurred)
Hi @cwc! Please don't tag individuals for help, as they might not be present or have the capacity to answer your queries. Instead, pose the question generally so that whoever is able can respond. You might also want to consider posting on Stack Overflow and/or the SilverStripe Forums. Thanks!
Hi @cheddam, it's actually a follow-up from https://github.com/silverstripe/silverstripe-framework/pull/9132#issuecomment-512571600
Ah, no worries then - sorry for the trouble 🙂
I did ask him to, but send me a direct message :-) also send me the output from your phpunit test run
Oh I see it’s under this thread, thanks
Ok so all those failures are related to hash mismatches. I’m not sure why they’d be failing for you but not in Travis CI, aside from maybe windows versus Unix, but my suggestion would be to write a new test anyway and ignore those failures for now 😄
Yeah, I've been doing that, but splitting 100+ classes into their own files manually is a tincy tedius
your IDE should have a refactoring tool like "move class to file", maybe it can even split classes to separte files. In PHPStorm you can configure a directory to be root of a namespace, this helps you a lot.
TBH I didn't find an automatic way right now, but you also need to rename FooController to "FooController", cause `` is not allowed in PSR4 classnames
Thanks for the suggestions @wmk I've checked with VSCode but I wasn't able to find refactoring tools for PHP. It's fascinating this process hasn't been addressed within the community already.
I've wanted to play with Python for a while so started a script last night to separate classes into files. It'll be simple as, but hopefully it should do the trick.
sounds cool... I dunno VSCode for PHP, but PHPStorm/IntelliJ has so many little helpers for me that boost my productivity. Used e.g. "extract method" yesterday while refactoring code... A nice shortcut for putting a bunch of lines in a seperate method.
I think it's something you should do first before running the upgrader :>
I was considering creating a simple script to separate classes into files but don't want to be reinventing the wheel