while running the phpunit project am getting error like "cannot open file src/autoload.php". i tried with this reference https://phpunit.de/getting-started.html. In cmd i used the below command line >> phpunit --bootstrap src/autoload.php tests/MoneyTest please anyone help me to solve this issue.

Member Avatar
Member Avatar
+0 forum 4

Hey guys, this seems to be a thorn in my side. I've been working on scraping a website which uses aspx and has eventvalidation/viewstate inputs. Every other scraping experiment I've made was not this difficult. Maybe one of you geniuses here at Daniweb has an idea of how to solve this? I've managed to get Selenium/PHPUnit to automate the process of opening the browser, typing in the URL, filling out the required fields (todays date), and then landing on the page I need to scrape and can get the viewstate and eventvalidation values from any of those pages. I've been …

Member Avatar
Member Avatar
+0 forum 2

I am new to PHPUnit & unit-testing in general, I have got this problem, thankfully I can sense, the answer is out there, maybe with everyone has ever done their first tests. Here it goes: I have been trying to find tutorials for unit-testing with PHPUnit. And, so far all, I found were similar tutorials, in which they all used assertEquals() function to test if a method from class output was as expected or not. like in this tutorial http://www.sitepoint.com/tutorial-introduction-to-unit-testing-in-php-with-phpunit/ and phpmaster.com/getting-started-with-phpunit/ It just shows a simple example for comparing expected and actual strings from a method. OK! I get …

Member Avatar
Member Avatar
+0 forum 1

I have an interesting problem and have searched the internet, but haven't yet found an answer. Consider the following function: function get_setting_values_from_file( $parameter ) { exec("/usr/var/binary --options $parameter", $output, $return); $settings = file( $output[0] ); } I need to unit test a similar function. I am currently using phpUnit for my tests and the vfsStream libraries to mock the file system, but how do you mock the binary file available on the system or what is the recommend approach for dealing with test cases like this? All feedback is appreciated.

Member Avatar
Member Avatar
+0 forum 2

Hi, I've been reading into testing my PHP code particularly unit testing using PHPUnit. The problem I have is that most of my code is procedural with not even many functions. I have read that unit testing is more suitable for OO PHP however i have seen that many people say it can be used to test procedural. However, the examples i have seen of this have not been with code similar to mine. I was wondering if anyone could demonstrate with some of my code how i would unit test parts of it. I have included my file that …

Member Avatar
Member Avatar
+0 forum 4

The End.