Recently Browsing 0 members
No registered users viewing this page.
I am currently developing a little application which is supposed to run on a raspberry. I decided to take advantage of PW's capabilities to deal with data not only in the sense of a common website but more as an application.
I wrote a lot of modules for this and I wrote tests for some of the methods (using PHPUnit). This works fine so far for methods which are independent from database (e.g. calculating an upcoming date/time by a given schedule). Now I am thinking of extending this by writing tests also for methods which rely on data from the database (e.g. it need to be checked if something exists on that given date/time). This information is currently stored as page in PW.
One of my thoughts: create necessary pages in PW for running the test and delete them afterwards. But somehow this just feels wrong.
Any kind of input how you would tackle this would be great!
Thanks a lot!
I'm writing this to give back something to the community that has given so much up front over the past year.
I noticed there's hardly any discussion about testing in these forums so I decided to write this quick primer to get some discussion going.
I'm by no means an expert on phpunit or selenium but I had to jump through a few hoops to get it working (especially with PHPStorm), so I thought I figured I should share my experiences with the community.
Also, I'm hoping non Phpstorm users can still pick something up useful in this post.
Prerequisites : It is assumed Phpunit (https://phpunit.de/) is installed via Composer, Selenium (http://www.seleniumhq.org/) and Php-webdriver for Selenium (https://github.com/facebook/php-webdriver) is preinstalled.
For Phpstorm users, there's a fairly detailed installation and unit testing instructions here (https://www.jetbrains.com/help/phpstorm/2016.1/testing.html)
I found some parts of it leaving me with unanswered questions, so I'm hoping this post will supplement any questions that you might encounter.
Rather than writing a single monolithic post, I will write several posts covering different topics.
Hi fellow Processwirers (?),
I was wondering if anyone here uses PHPStorm in conjunction with PhpUnit?
In particular, I'm trying to get it to work with Processwire so I can incorporate the Pages & other intrinsic Processwire objects into the testing.
Any example or real life configuration examples would be most welcome.
Thanks in advance.
Now that 2.3 has been finished, when will you (Ryan) start developing 2.4?
According to the roadmap 2.4 will port the hole system to PHP 5.3+ which I think is great.
It says we'll get namespaces, PSR-0 and PSR-1 support. What exactly does it mean? Will it use Composer? I really think it should as it's the greatest asset for the future of PHP. We could keep the framework seperate so that others can use it (http://processwire.com/talk/topic/818-currentformer-textpattern-users-what-do-you-think-txp5-using-pw/).
I'd also like if PW used some proved libraries from (for example) Symfony (http://symfony.com/components) or Laravel (http://github.com/illuminate). Maybe because I'd love a "Processwire on Laravel (Components) with Craft-like design"
Just interested in how Ryan is going to make PW adopt 5.3, PSR + Composer will push PHP in the future and there are great libraries that are well (unit-)tested and could be used.