Questions tagged [zend-test]

Unit Testing a Zend Framework

51 questions
1
vote
1 answer

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.
Paul R Rogers
  • 914
  • 1
  • 9
  • 19
1
vote
1 answer

Bootstrapping Zend_Application with Zend_Test

in the docs the provided code for bootstrapping looks like protected $application; public function setUp() { $this->bootstrap = array($this, 'appBootstrap'); parent::setUp(); } public function appBootstrap() { $this->application = new…
Jiew Meng
  • 84,767
  • 185
  • 495
  • 805
1
vote
2 answers

How do I bootstrap for unit testing with Zend MVC and Zend_Test?

I have read many posts about setting up unit testing in Zend Framework and I simply have not been able to get even one simple unit test to run. The issue is with setting up and testing the bootstrap environment. I tried the simplest of ways using…
MikeH
  • 796
  • 7
  • 18
1
vote
1 answer

PHPUnit Mock Object replacing Real Class

I have a couple of tests in my test suite being run in Zend_Test One test creates a mock of Foo_Bar_Baz via PHPUnit's MockBuilder as that class its dependency. Now in the test for Foo_BAR_baz (the change in case is on purpose and is necessary due…
Schleis
  • 41,516
  • 7
  • 68
  • 87
1
vote
2 answers

How to test my Zend Framework models when my database privileges are limited?

I am working on a PHP (Zend Framework 1.12.1) application that ties into a database in a somewhat unique way. Basically, we have an Oracle database that is a "black box" to me. I do not have privileges to select, update, insert, or delete any rows…
fronzee
  • 1,668
  • 2
  • 21
  • 32
1
vote
1 answer

Zend Framework 2 - UnitTests

I want to create a simple access unit test like it is shown in the tutorial. My project uses ZFCUser for authentication. As a result my (obviously not authenticated) tester get a HTTP response of 302 and not the expected 200. Any ideas what I can do…
Ron
  • 22,128
  • 31
  • 108
  • 206
1
vote
1 answer

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 Zend_Test_PHPUnit_Constraint_ResponseHeader::evaluate() should be compatible with that of…
Awais Qarni
  • 17,492
  • 24
  • 75
  • 137
1
vote
1 answer

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 work: class IntegrationalTest extends…
Dmitry
  • 7,457
  • 12
  • 57
  • 83
0
votes
2 answers

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 up Zend test, however, after hours of research,…
nick
  • 92
  • 1
  • 8
0
votes
1 answer

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 that's not exactly what I'm testing right now…
Andrew
  • 227,796
  • 193
  • 515
  • 708
0
votes
1 answer

Zend_Test on Action_Helper accessing $bootstrap->getOptions() error

I am accessing options from an action controller, which is working well with the application, but I've hit a problem when I attempt to UnitTest it: PHP Fatal error: Call to a member function getOptions() on a non-object in…
Jon Skarpeteig
  • 4,118
  • 7
  • 34
  • 53
0
votes
1 answer

Type Error exception while unit testing (zend-test, PHPUnit)

I am trying to test a simple controller action in Zend FrameWork and I am not 100% sure why my mocks are not working. Original Action: public function overviewAction() { $page = $this->params()->fromQuery('page', 1); $count =…
HappyCoder
  • 5,985
  • 6
  • 42
  • 73
0
votes
1 answer

How do I use PHPUnit to test a Controller under ZFC RBAC

I am pretty new to unit testing and have just started my journey learning how to use tests to make my applications more reliable. I am using Zend Framework 3 and am following this guide https://docs.zendframework.com/tutorials/unit-testing/ What I…
HappyCoder
  • 5,985
  • 6
  • 42
  • 73
0
votes
2 answers

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 Example{ protected $_val=null; function…
Ben
  • 25,389
  • 34
  • 109
  • 165
0
votes
1 answer

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…
Jiew Meng
  • 84,767
  • 185
  • 495
  • 805