I'm pretty sure this helper isn't needed, and is just circumventing APIs at this point.
More to come.

Comments

tim.plunkett’s picture

Status: Active » Needs review
StatusFileSize
new35.39 KB

This is still a work in progress, I have another idea to add on top of this.

Status: Needs review » Needs work

The last submitted patch, views-1778438-1.patch, failed testing.

dawehner’s picture

I'm wondering whether the easiest solution wouldn't be the best way to actually improve the readability of the tests:

  • Remove $this->view
  • Remove all custom creation method for views, like $this->getBasicView(), $this->getView()
  • Just use views_get_view('test_foo_bar'). This function is quite well known for most people. Another important point is, that you can directly see the kind of file you want to search for.
dawehner’s picture

Issue tags: +VDC

.

tim.plunkett’s picture

Status: Needs work » Needs review
StatusFileSize
new35.38 KB

Well $this->view just died in that last patch.

I'm not 100% sold on removing $this->getView() yet.

One idea for replacing getBasicView would be a static property of the view name to use for the test, since 90% of the tests only use one view.
Only CacheTest and ArgumentDefaultTest don't use this properly.

Status: Needs review » Needs work

The last submitted patch, views-1778438-5.patch, failed testing.

xjm’s picture

Project: Views (for Drupal 7) » Drupal core
Version: 8.x-3.x-dev » 8.x-dev
Component: Code » views.module
tim.plunkett’s picture

Title: Rethink ViewTestBase::createViewFromConfig() » Replace ViewTestBase::createViewFromConfig() and ViewTestBase::getBasicView() with views_get_view()
Assigned: tim.plunkett » Unassigned
Status: Needs work » Postponed

After further discussion, postponing.

damiankloip’s picture

Status: Postponed » Fixed

These have already been removed somewhere else along the way.

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