This seems to need a little more of work since we have to split 1 file into several, one for each test class.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

RobLoach’s picture

Title: Convert user interface test to PSR-0 » [8.x] Convert user interface test to PSR-0
Issue tags: +PSR-0, +VDC
dawehner’s picture

Version: 7.x-3.x-dev » 8.x-3.x-dev

and the version....

tim.plunkett’s picture

Title: [8.x] Convert user interface test to PSR-0 » Convert user interface test to PSR-0
damiankloip’s picture

FileSize
42.84 KB

Here is an initial patch for this. It seems everything in the views_ui.test file was a Wizard test So I have used folder structure/namespaces to match this.

damiankloip’s picture

Status: Active » Needs review
aspilicious’s picture

I kinda disagree here. These tests will probably move to the views_ui module when that one is splitted in its own folder.
Also "namespace Drupal\views\Tests\Ui\Wizard;" looks strange to me...

When it is moved the namespace will be "Drupal\views_ui\Tests" so why don't we make the transition easier and just go for "Drupal\views\Tests\Ui" for the moment I also don't see a reason for creating a wizard folder yet...

+++ b/lib/Drupal/views/Tests/Ui/Wizard/Basic.phpundefined
@@ -0,0 +1,139 @@
+use Drupal\views\Tests\Ui\Wizard\Helper;

When you're in the same namespace you don't need to "use" the class

+++ b/lib/Drupal/views/Tests/Ui/Wizard/Basic.phpundefined
@@ -0,0 +1,139 @@
+class Basic extends Helper {

Helper is a Bad name, it should be ViewsUiTestBase (or something similar). Also "Basic" doesn't say a thing this should have a different name.

+++ b/lib/Drupal/views/Tests/Ui/Wizard/TaggedWith.phpundefined
@@ -0,0 +1,180 @@
+class TaggedWith extends Helper {

TaggedWith doesn't say a thing about the tests it contains. Or does it?

This is just my opinion and it's based on experience and discussions I had with the core test switch to psr-0.

dawehner’s picture

I kinda disagree here. These tests will probably move to the views_ui module when that one is splitted in its own folder.
Also "namespace Drupal\views\Tests\Ui\Wizard;" looks strange to me...

I'm really not sure, because it decided to move the UI related code all to the ui module?
My personal opinion is, that these tests not only tests the wizard but some general workflow: create view, edit it and look at the result, so they should be together with the other tests.

aspilicious’s picture

Hmm ok, but do we need a wizard subfolder? We can call it "UiWizard" Ui/Wizard looks to verbose.

dawehner’s picture

UiWizard sounds like a good idea for me!

damiankloip’s picture

FileSize
42.61 KB

I think any Drupal namespaces will look quite verbose now, I don't see much difference in having Wizard in there too, so the classes have simpler names; which I thought was one of the ideas of using namespaces?! I prefer the way it is now, but I understand that we need to follow the core conventions. Anyway, I did have the class names as UiWizard... originally but then changed it again. Here is a patch that changes them to this.

aspilicious, I have also removed the use stuff as per post above. I also agree that the names Basic and Helper could be improved on :)

I'm not sure about changing the names like Basic and Helper yet, does this come into this conversion issue? If yes, just let me know and we can change them to something people agree on.

dawehner’s picture

FileSize
84.04 KB

http://drupal.org/node/1641662#comment-6171628 didn't split up the tests into seperate namespaces, which i think is the better approach. It is already hard to find stuff.

This patch also tackles some small stuff:

* views.info file
* the psr0.test hack for these tests

aspilicious’s picture

I would suffix the tests wit "Test" to be consistent. But other than that this looks good to go.

dawehner’s picture

Status: Needs review » Needs work

Ups sure.

damiankloip’s picture

ok, where are we at with this now? (sorry, been away) Do we just need to append Test to the classes?

damiankloip’s picture

Status: Needs work » Needs review
FileSize
84.26 KB

I think this is what we need for now?

RobLoach’s picture

Status: Needs review » Reviewed & tested by the community

Looks good!

dawehner’s picture

Status: Reviewed & tested by the community » Fixed

Lets get it in, yeaaah!

Automatically closed -- issue fixed for 2 weeks with no activity.