I set to protected/tests/unit and to protected/tests/functional. Since die IDE doesn’t provide a possibility to configure these settings once they are set, I edited nbproject/project.properties. Last try: select different folders for unit testing and functional testing. Still no connection to selenium rc server, plus unit tests I didn’t intend to run. The output was exactly the same as when I pressed +. Now I was able to select “Run selenium tests” from the project folder. A chose protected/tests again, then canceled the dialog. I told netbeans to create a new “Selenium Test Case for PHP”, which again brought up a dialog that allowed me to specify a test folder. Trying to run only functional tests, I came across the problem, that the menu entry wasn’t enabled. So SiteTest seems to be executed twice, first as unit test, second as functional test. Some Details: LoginFormTest passes, SiteTest is skipped (no valid test cases found), SiteTest (Firefox) fails (could not connect to selenium rc server). Single unit test still works, + still fails. I also configured PHPUnit to use the phpunit.xml file as XML configuration and disabled the bootstrap checkbox, since the xml seems to configure it already. I reviewed WebTestCase.php (changing the TEST_BASE_URL), bootstrap.php (seems okay) and phpunit.xml (removing the browser entry for IE). Maybe because of the “functional” folder within the “Test Files”? I can only guess, that netbeans tries to start every file within this folder if you just say “test”… Until this point, I only wanted to do some unit testing, so I don’t know why netbeans tried to start functional tests. Something about IE could not been started (sure, I’m on Ubuntu right now) and that a connection to selenium rc could not be established. Pressing + took a while, and resulted in some errors. Now the single test passes, but I can’t figure out how I would run all my unit tests? When I tried to run that test, PHPUnit again complained that it didn’t know CTestCase, so I configured it to use tests/bootstrap.php as bootstrap file. $this->assertTrue( count($loginForm->rules()) = 3 ) Now I thought it was time to check if unit testing works, so I put a dummy test for LoginForm into tests/unit: ![]() But the project explorer now shows a folder “Test Files” below “Source Files”. The generation of the unit test fails, because PHPUnit doesn’t find the class CFormModel. This drives netbeans to ask for a test folder, which I set to protected/tests. So I tried to generate a test case for the LoginForm model. Setting up the test directory was the first trouble: for some reason, I can’t do that in the project properties (text field takes no input). I started with an empty webapp created by yiic, then created a new netbeans project with existing source. I have installed netbeans v6.8, phpunit v3.5 and netbeans’ plugin “Selenium Module for PHP” v1.0. Can anyone help me to get this working, please?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |