Tagged Questions
7
votes
1answer
4k views
Zend Framework (PHPUnit) Tests won'r run (phpunit: command not found / Class 'PHPUnit_Framework_TestCase' not found)
i installed PHPUnit by the book:
sudo pear channel-discover pear.phpunit.de
sudo pear install phpunit/PHPUnit
The include path is added in the /etc/php5/cli/php.ini
include_path = ...
6
votes
3answers
529 views
How can I in PHP re-create my Database (for Unit Testing for example)
How can I from PHP, re-create my Database, maybe inserting default data. Currently, I am intending to use the behavior for Unit Tests.
I am using Doctrine 2, Zend Framework 1.11, Zend_Test for unit ...
5
votes
1answer
1k views
Unit testing with Zend Framework/Doctrine 2.0
I wanted to write unit tests for my Zend Framework/Doctrine 2.0 application, but I don't quite understand how to set up unit testing in ZF. Also, I would like to include Doctrine 2.0 in those unit ...
4
votes
2answers
1k views
Zend_Controller_Router_Exception: Route default is not defined
I'm trying to test a controller. Zend Tool has generated the following code:
class Default_CarrinhoControllerTest extends Zend_Test_PHPUnit_ControllerTestCase
{
public function setUp()
{
...
4
votes
1answer
752 views
Setup PHPUnit with Zend Test
I'm trying to start using PHPUnit with Zend Test for my Zend Framework application. I'm able to run the PHPUnit command from command line phpunit --configuration phpunit.xml. I've tried following ...
3
votes
1answer
1k views
Code coverage fails with PHPUnit and the Zend Framework
I have some issues with code coverage reports in PHPunit and the zend framework. Whenever I run a phpunit test the code coverage fails returning the following message:
PHPUnit 3.4.15 by Sebastian ...
2
votes
1answer
199 views
Phpunit Error - failed asserting node denoted by
I am using PHPUnit 3.5.x along with Zend 1.10
I have a line in my IndexControllerTestCase.php
$this->assertXpathContentContains("id('message')", "test message");
this shows an error
1) ...
2
votes
2answers
2k views
Zend_Test: No default module defined for this application
UPDATE 23 Dec
I had the problem where Zend Framework complains about "No default module defined for this application". I didn't use Modules and the main app works fine.
I finally solved the problem ...
2
votes
2answers
1k views
Unit Testing Doctrine 2 Models
Whats the way to unit test Doctrine 2 models? I am using it with Zend Framework 1.11. It has Zend_Test which uses PHPUnit. I think the right thing to use is PHPUnit_Extensions_Database_TestCase. In ...
2
votes
1answer
28 views
How to assert the full response, not just the“view” part using Zend_Test_PHPUnit?
I want to test that my /login page is working well and rejecting invalid credentials i.e. not redirecting to the user's dashboard and showing an aller message identified here with the .alert HTML ...
1
vote
2answers
393 views
XPath in PHPUnit testing with Zend
I have this apparently basic code:
$docSrc =
'<?xml version="1.0" encoding="UTF-8" ?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title /></head>
...
1
vote
1answer
39 views
Zend_Test, identity and cookies
I have ZF1 site and I'm testing it with phpunit.
I want to store cookies from one test(login) and pass it to other tests(post messages, etc).
Or is there any way to setIdentity?
This method doesn't ...
1
vote
2answers
1k views
(PHP): Testing models with Zend_Test_PHPUnit_DatabaseTestCase
When I run my PHP unit test I get:
1) Test_Model_Mapper_TestTest::testTest
Argument 1 passed to PHPUnit_Extensions_Database_DataSet_DefaultTableIterator::__construct() must be an array, null given, ...
1
vote
2answers
1k views
PHPUnit/Zend_Test: PDOException: You cannot serialize or unserialize PDO instances
I am getting the exception
PDOException: You cannot serialize or unserialize PDO instances
when I am trying to use PHPUnit for Unit Tests. I have not much going on. I am using Zend Framework ...
1
vote
1answer
705 views
“No such file or directory” SQLSTATE error using PHPUnit with XAMPP & Zend Framework
The error I'm getting is below.
Zend_Db_Adapter_Exception: SQLSTATE[HY000] [2002] No such file or directory
I've tried setting the xampp php to be the php in my PATH, hoping that it's a ...
0
votes
1answer
1k views
Unit Testing with Zend_Test: Call to a member function hasResource() on a non-object in Zend's ErrorController
I am getting this error
Fatal error: Call to a member function hasResource() on a non-object in D:\Projects\Tickle\application\controllers\ErrorController.php on line 53
where line 53 looks like
...
0
votes
2answers
550 views
PHPUnit::How can be __construct with protected variables tested?
PhpUnit::How can be __construct with protected variables tested?
(not always we should add public method getVal()- soo without add method that return protected variable value)
Example:
class ...
0
votes
2answers
321 views
PHPUnit+ZendFramework ::How I can test multu users session in the same time?
I beginer programmer,and don't have any QA experience
(only simple test that i write without PHPUnit or other tool)
How I can create test for testing multi users sessions in the same time?
...
0
votes
1answer
26 views
Zend_Test_PHPUnit versus Selenium
I have used Zend_Test_PHPUnit before for integration tests and it was great. I could configure a request object and fire it off, and run asserts against the results, including using CSS selectors.
...
0
votes
1answer
104 views
Zend Test assertResponseCode incompatible with PHPUnit?
I am trying to use Zend Test and PHPUnit to test an application I've built. I'm just in the early stages of getting things setup and have run into some problems (see this fun problem). But besides ...
0
votes
2answers
337 views
Setting up a Controller Test with ZendFramework: Autoloader issue
I'm working on a web application with Zend Framework v1.11.0, but I'm failing to set up a correct test environment for controller tests.
I know that there are already a lot of questions about setting ...
0
votes
1answer
125 views
How to mock/stub a call to the database in a Zend_Test_PHPUnit_ControllerTestCase?
I am writing my first controller test. Internally the controller must call (or extend) a file that tries to connect to the database. However, I don't want it to actually connect to a database, since ...
0
votes
1answer
480 views
How Does One Produce a Selenium Test with Database Fixture
Zend Test appears to rely upon Zend_Test_PHPUnit_DatabaseTestCase and Selenium appears to need PHPUnit_Extensions_SeleniumTestCase yet as far as I can tell PHP doesn't support multiple inheritance.
0
votes
3answers
226 views
Testing controller with Zend_Test
I asked the same question in another forum, but I don't yet have any luck there. So please allow me to ask the same question here.
I want to setup Zend_Test to test my controller code (I am using ...
0
votes
1answer
63 views
PHPunit Comaptiablity issue with Zend
I have configured PHPUnit with Zend Framework. When I run the command
phpunit --configuration phpunit.xml
I receive the failure message like
Declaration of ...
0
votes
0answers
20 views
Zend_Form phpunit and file field
How can I test form with file field (it has option "ignoreNoFile" => true) with Zend_Test?
I tried, but form didn't pass validation with no errors. Error somewhere in ...
0
votes
0answers
363 views
How to PHPUnit Zend_Test&Doctrine2 in Zend Studio
I can use CLI(phpunit --configuration phpunit.xml) to run the tests normally.
The tests directory has such hierarchy:
tests
├── application
│ ├── bootstrap.php
│ ├── controllers
│ │ └── ...
0
votes
0answers
109 views
how to test HEAD section contains link to CSS file in conditional comments
How to write a more elegant Unit-Test to assert the ie.css file for certain browsers has been added to the head section between conditional comments:
order of attributes may differ
spaces can be on ...
0
votes
1answer
156 views
PHPunit, Getting function code coverage for a ZF controller action
I'm using PHPunit to test our Zend Framework project and it works allright but i'm not getting coverage om my action methods in my controllers.
Although I get coverage in number off lines of code but ...
0
votes
1answer
431 views
Unit Testing with PHPUnit & Doctrine2: Autoloading Failed
I am getting this error
D:\Projects\Tickle\tests>phpunit
PHPUnit 3.5.5 by Sebastian Bergmann.
..........ok1
Fatal error: Doctrine\Common\ClassLoader::loadClass(): Failed opening required ...