-
Recently Browsing 0 members
No registered users viewing this page.
-
Similar Content
-
By Richard Jedlička
Tense
Tense (Test ENvironment Setup & Execution) is a command-line tool to easily run tests agains multiple versions of ProcessWire CMF.
Are you building a module, or a template and you need to make sure it works in all supported ProcessWire versions? Then Tense is exactly what you need. Write the tests in any testing framework, tell Tense which ProcessWire versions you are interested in and it will do the rest for you.
See example or see usage in a real project.
How to use?
1. Install it:
composer global require uiii/tense 2. Create tense.yml config:
tense init 3. Run it:
tense run
For detailed instructions see Github page: https://github.com/uiii/tense
This is made possible thanks to the great wireshell tool by @justb3a, @marcus and others.
What do you think about it? Do you find it useful? Do you have some idea? Did you find some bug? Tell me you opinion. Write it here or in the issue tracker.
-
By Robin S
This module is inspired by and similar to the Template Stubs module. The author of that module has not been active in the PW community for several years now and parts of the code for that module didn't make sense to me, so I decided to create my own module. Auto Template Stubs has only been tested with PhpStorm because that is the IDE that I use.
Auto Template Stubs
Automatically creates stub files for templates when fields or fieldgroups are saved.
Stub files are useful if you are using an IDE (e.g. PhpStorm) that provides code assistance - the stub files let the IDE know what fields exist in each template and what data type each field returns. Depending on your IDE's features you get benefits such as code completion for field names as you type, type inference, inspection, documentation, etc.
Installation
Install the Auto Template Stubs module.
Configuration
You can change the class name prefix setting in the module config if you like. It's good to use a class name prefix because it reduces the chance that the class name will clash with an existing class name.
The directory path used to store the stub files is configurable.
There is a checkbox to manually trigger the regeneration of all stub files if needed.
Usage
Add a line near the top of each of your template files to tell your IDE what stub class name to associate with the $page variable within the template file. For example, with the default class name prefix you would add the following line at the top of the home.php template file:
/** @var tpl_home $page */ Now enjoy code completion, etc, in your IDE.
Adding data types for non-core Fieldtype modules
The module includes the data types returned by all the core Fieldtype modules. If you want to add data types returned by one or more non-core Fieldtype modules then you can hook the AutoTemplateStubs::getReturnTypes() method. For example, in /site/ready.php:
// Add data types for some non-core Fieldtype modules $wire->addHookAfter('AutoTemplateStubs::getReturnTypes', function(HookEvent $event) { $extra_types = [ 'FieldtypeDecimal' => 'string', 'FieldtypeLeafletMapMarker' => 'LeafletMapMarker', 'FieldtypeRepeaterMatrix' => 'RepeaterMatrixPageArray', 'FieldtypeTable' => 'TableRows', ]; $event->return = $event->return + $extra_types; }); Credits
Inspired by and much credit to the Template Stubs module by mindplay.dk.
https://github.com/Toutouwai/AutoTemplateStubs
https://modules.processwire.com/modules/auto-template-stubs/
-
By Peter Knight
I have a few web forms which require testing on a weekly basis and I don't want the recipients (administrators) to receive these test emails.
What would be a good way to test approx 15 forms from the front end and have the test delivered a list of secondary administrator recipients?
I'm thinking that I could have some kind of config file which watches for a trigger word or email and then understands that it's a test and to bypass the normal admins?
All of the forms ask for an email address so I could setup an email such as 'testform@email.not' etc which my config file (hook?) would watch for.
Or is there a better way to do this?
Additionally, I have a few extra requirements...
Forms should goto an alternative success page. This is because I don't want my test to skew my Google Analytics conversion tracking Forms would need to be tested from the front-end and not the PW admin area Any advice appreciated.
BTW I realise this should be posted in the proper FormBuilder support forum. I am in the process of renewing my license for access to that support forum.
-
By Sergio
Confession bear meme on tests: I'm a virgin.
Never implemented any of them, mostly because I work alone for many years now. But found this cool project today, called Cypress.
This is the easiest way to test a website or app I've found. Check their intro video out: https://docs.cypress.io/guides/getting-started/writing-your-first-test.html
Note: I recommend this Chrome extension to speed up videos: https://github.com/igrigorik/videospeed as the narration of this video is kinda slow. 🙂
-
By tpr
ProcessNetteTester
Run Nette Tester tests within ProcessWire admin.
(continued from here)
Features
AJAX interface for running Nette Tester tests, in bulk or manually display counter, error message and execution time in a table run all tests at once or launch single tests show formatted test error messages and report PHP syntax errors stop on first failed test (optional) hide passed tests (optional) display failed/total instead passed/total (optional) re-run failed tests only (optional) auto scroll (optional) include or exclude tests based on query parameters start/stop all tests with the spacebar reset one test or all tests (ctrl+click) TracyDebugger File Editor integration https://modules.processwire.com/modules/process-nette-tester/
https://github.com/rolandtoth/ProcessNetteTester
-