Jump to content

rmenu

Members
  • Posts

    2
  • Joined

  • Last visited

rmenu's Achievements

Newbie

Newbie (2/6)

1

Reputation

  1. i found another module with some interesting piece of code for unit testing https://github.com/wanze/SeoMaestro Overall, does this mean most of the PW code is not tested?
  2. Hi, I jumped into PW a few months ago and now is the moment when i want/need to have unit tests. No really on the CMS part but more likely on the modules or pages classes i create. However i was not able to find a "how to" to do so. How do i get fake data (factory for users), bootstrap everything to be able to call the method inside a module or unit test a hook applied a core module? I dont get a clear idea of how to achieve that under PW. As an example, let say i created a survey Module. and let say i have a fct like this within my module <?php namespace ProcessWire; class Survey extends WireData implements Module public function__construct() { [blablabla] } public function getSurveyUrl($lang) { $surveyPage = $this->pages->get('template=survey); return $surveyPage->localUrl($lang); } How would i create a unit test for that? Thanks in advance Note: i ve already read the FrancisChung post but it looks like a work around (for front end) rather that the "comme il faut" way
×
×
  • Create New...