Recently Browsing 0 members
No registered users viewing this page.
I am trying to include the unit tests into our project which is in Processwire(I love it).
Directory structure for the same will be shown below
Here PWTestCase.php is the parent file where it is getting inherited from the PHPUNIT framework TestCase class and It is in same namespace ProcessWire; as shown below
Now I have a basic unit test(FuncTest.php as shown below) to check the language calling the function getLanguage() residing in site/templates/_func.php.
***when try to run this test, getting undefined function getLanguage as shown below***
Since I am using namespace ProcessWire; & bootstraping processwire in PWTestCase why i am not able to access functions? Can you please suggest where i am going wrong?
Thanks in advance.
PHPStorm for PW Devs
This thread is a place for ProcessWire developers who use PHPStorm to share their experience, tips, frustrations, solutions, code snippets and generally discuss all things PHPStorm.
Thanks @kongondo for the Visual Studio Code post earlier.
While I was reading Smashing Magazine, I discovered this handy tool called XRespond that lets you load webpages in iframes that are designed to simulate different devices, (similar to how browsers' mobile simulators work).
I think it's quite useful for local development. In fact it works for any website as long as it doesnt have `X-Frame-Options` headers set to `sameorigin`. I highly recommend using it with browser-sync with live loading as well. I use this settings when using it with PHPStorm to live reload my dev site on pw.dev.
// remember set cwd to /site/templates/ or call it from templates directory path/to/browser-sync.cmd start --proxy pw.dev --port 8080 --files "**/*.php" --files "assets/**/*.css" --files "assets/**/*.css"
What other tools/utilities do you use for testing your responsive designs?
By Richard Jedlička
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:
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.
I'm using GitLab CI for continuous integration right now. Other people might use something like Travis CI. For the frontend part things are pretty easy:
image: node:6.10.3 cache: paths: - node_modules/ build: script: - npm install - node_modules/.bin/gulp build Now I could extend my setup to run tests or whatever I want. It just works.
In this post I'm not interested into finding out how I could go about testing and stuff. I just want to know how I could accomplish the equivalent to the above setup task for ProcessWire. It doesn't seem to be too easy to me since the installation process is running in the browser asking you a lot of stuff. How could I go about it using the CLI?
That's what I currently have:
git clone email@example.com:processwire/processwire.git cd processwire mv site-blank site rm .gitignore git submodule add -b develop firstname.lastname@example.org:path/to/MyModule.git site/modules/MyModule From here on I'm stuck.
The only possible solution I see is maintaining a super repository including a database dump that has it's module dependencies defined in a .gitmodules file. This could then be installed using:
git clone --recursive git@... Once that's completed all that needs to be done would be to create the database using the dump.
Probably that's a pretty solid solution but it adds the overhead of having to maintain an additional repository + database dump. I'm trying to find an alternative that's using the original processwire repository. That way I could just rerun my build once a new version get's merged into master and see if everything would be still working as well.
I'm looking forward to your replies. Thanks!