PHPUnit is the de facto standard for writing unit tests for PHP code.
10
votes
0answers
560 views
ZF2 unit-testing authentication
I was learning about unit testing and I attempted to resolve the following issue:
Zend\ServiceManager\ServiceManager::get was unable to fetch or create an instance for zfcUserAuthentication
... ...
4
votes
0answers
122 views
Jenkins build multi-configuration project with MTAF not working on Sauce Labs
I configured the Magento Test Automation Framework (MTAF) with Jenkins and Sauce Labs and everything is working well. However, when building a multi-configuration project, I have selected two more ...
4
votes
0answers
458 views
phpunit restarting tests randomly
I am trying to test my symfony2 application using PHPUnit. I got one project where everything works as expected, but on my other project I have this strange behaviour that PHPUnit either stops ...
2
votes
0answers
75 views
Why does phpunit not show any errors in the console
I'm using phpunit with Laravel 4 framework. Why is it that when there's a PHP error during the tests, no error messages are shown (eg: missing method)?
How can we get phpunit to show all errors?
2
votes
0answers
135 views
Stub / Mock Zend Db in Zend Framework 2
i'm trying to stub specific part of Zend Db.
$statement = $this->getAdapter()->createStatement();
$query->prepareStatement($this->getAdapter(), $statement);
So $this->getAdapter() is ...
2
votes
0answers
39 views
Test access_control in Symfony2
I want to test that my access_control is working as expected, that certain roles don't have access to a page while other roles do.
I can do this using Functional Tests, logging in each user and ...
2
votes
0answers
115 views
Cannot access PHPUNIT_SELENIUM_TEST_ID cookie in PHPUnit Coverage
To use phpunit_coverage.php I need to set auto_prepend_file and auto_append_file properties in php.ini to specified files prepend.php and append.php. In both scripts cookies are checked to make sure ...
2
votes
0answers
223 views
Make netbeans use virtual box guest installation of phpunit
We use netbean's phpunit / unit testing plugins for all our testing. We used to use xampp and point netbeans at our our .bat file from the xampp installation. We recently started using vagrant and ...
2
votes
0answers
97 views
Erroneous failure running PHPT with PHPUnit on PHP 5.4.6
PHPUnit runs regular tests without trouble, but it mistakenly reports this basic PHPT example as failing when it should pass:
--TEST--
strtr() function - basic test for strstr()
--FILE--
<?php
/* ...
2
votes
0answers
227 views
PHPUnit & Selenium code coverage - coverage metrics stop halfway through test
I'm just getting started with PHPUnit and Selenium, yet one problem has been bothering me: I can't seem to get correct coverage figures.
My app takes a user through a multi-step process that ...
1
vote
0answers
22 views
How to test that filter was triggerd on an action execution with PHPUnit
I have an Yii Controller with an action and filter bound to it, like this:
...
public function testAction() {}
public function filters() {
return array(array('CMyFilter +test'));
}
...
I can't ...
1
vote
0answers
12 views
PHPUnit & Selenium2 all cases fail IF one case fails
I am using PHPUnit & Selenium2 server. I am using PageObject pattern. To a page object I get an instance of the webdriver and perform necessary functions.
To keep a single browser running I ...
1
vote
0answers
27 views
Is there a way assert to assert file is not empty in PHPUnit?
I am writing a unit a test for a method which is supposed to be able to locate a file and write to it. PHPUnit has methods to compare two files, whether it exists or not, however I am not able to find ...
1
vote
0answers
50 views
Sonar php analyzeOnly - no analyse work
I don't understand why my build sonar not read my phpUnit xml log.
# Required metadata
sonar.projectKey=org.wewakeweb.sonar:culturalstore
sonar.projectName=culturalStore
sonar.projectVersion=1.0
# ...
1
vote
0answers
27 views
PHPUnit, Netbeans and Symfony2 and wrong tests location
I try to understand PHPUnit tests in Netbeans. I set correct phpunit.bat path and the phpunit-skelgen.bat file as well.
When I try to create test for some file, using the netbeans option such us ...