# \#phpunit

**URL:** https://discourse.laminas.dev/tag/phpunit/28.md

[Latest](https://discourse.laminas.dev/latest.md) · [Categories](https://discourse.laminas.dev/categories.md) · [Tags](https://discourse.laminas.dev/tags.md)

---

## [Unit Testing File Upload Postprocessing](https://discourse.laminas.dev/t/unit-testing-file-upload-postprocessing/2411)

<div class="topic-metadata">

**Author:** [@makxk](https://discourse.laminas.dev/u/makxk)\
**Replies:** 3\
**Last updated:** [June 5, 2025, 9:17am UTC](https://discourse.laminas.dev/t/unit-testing-file-upload-postprocessing/2411 "2025-06-05T09:17:22Z")

</div>

Hello everyone! I’ve been trying my hands on a somewhat stateless file upload: User uploads a file, the controller processes it and returns a form with pre-filled out fields based on the values from the file. The upload…

---

## [Issue with laminas-test unit testing](https://discourse.laminas.dev/t/issue-with-laminas-test-unit-testing/3681)

<div class="topic-metadata">

**Author:** [@Tharisha\_Perera](https://discourse.laminas.dev/u/Tharisha_Perera)\
**Replies:** 5\
**Last updated:** [May 3, 2024, 7:46pm UTC](https://discourse.laminas.dev/t/issue-with-laminas-test-unit-testing/3681 "2024-05-03T19:46:17Z")

</div>

I’m new to Laminas framework and Unit testing and working with a Laminas framework project and I want to start unit testing in that application. I used laminas-test package and followed their tutorial. when I execute th…

---

## [How to write unit tests in Laminas api tools for the resources not for controller](https://discourse.laminas.dev/t/how-to-write-unit-tests-in-laminas-api-tools-for-the-resources-not-for-controller/3576)

<div class="topic-metadata">

**Author:** [@karthikeyan-manivasa](https://discourse.laminas.dev/u/karthikeyan-manivasa)\
**Replies:** 8\
**Last updated:** [January 10, 2024, 7:25pm UTC](https://discourse.laminas.dev/t/how-to-write-unit-tests-in-laminas-api-tools-for-the-resources-not-for-controller/3576 "2024-01-10T19:25:34Z")

</div>

How to write tests for resources that extend this class Laminas\\ApiTools\\Rest\\AbstractResourceListener, I don’t think the official documentation has anything related to this AbstractHttpControllerTestCase class can be …

---

## [How to init Database connection in phpunit Functional test](https://discourse.laminas.dev/t/how-to-init-database-connection-in-phpunit-functional-test/3503)

<div class="topic-metadata">

**Author:** [@rolek](https://discourse.laminas.dev/u/rolek)\
**Replies:** 2\
**Last updated:** [October 18, 2023, 7:13pm UTC](https://discourse.laminas.dev/t/how-to-init-database-connection-in-phpunit-functional-test/3503 "2023-10-18T19:13:44Z")

</div>

Hi everyone! I’m trying to write some functional tests for my application. I found this post Mezzio Example: Functional and Unit Testing - Marc Guyer which got me started somewhat, but the problem I’m having is that whe…

---

## [UnitTest with laminas/laminas-test - Request is not an HTTP Request](https://discourse.laminas.dev/t/unittest-with-laminas-laminas-test-request-is-not-an-http-request/2886)

<div class="topic-metadata">

**Author:** [@Stefan\_B](https://discourse.laminas.dev/u/Stefan_B)\
**Replies:** 7\
**Last updated:** [November 16, 2022, 7:42am UTC](https://discourse.laminas.dev/t/unittest-with-laminas-laminas-test-request-is-not-an-http-request/2886 "2022-11-16T07:42:19Z")

</div>

I try to set up unit tests for a new project. Added unittest and the laminas-test module. My issue is when i just follow the tutorials, i run into an error not getting the right request type in the application. Error : …

---

## [How to give options in command line tool for PHPUnit command in laminas](https://discourse.laminas.dev/t/how-to-give-options-in-command-line-tool-for-phpunit-command-in-laminas/2821)

<div class="topic-metadata">

**Author:** [@ALTAMASH80](https://discourse.laminas.dev/u/ALTAMASH80)\
**Replies:** 2\
**Last updated:** [March 18, 2022, 7:51am UTC](https://discourse.laminas.dev/t/how-to-give-options-in-command-line-tool-for-phpunit-command-in-laminas/2821 "2022-03-18T07:51:54Z")

</div>

Hi, I tried to use the PHPUnit option --testdox and it didn’t work. Example below: composer test --testdox Whereas the below command worked. ./vendor/bin/phpunit --testdox Thanks!

---

## [Unit Testing Laminas Skeleton Appliacation](https://discourse.laminas.dev/t/unit-testing-laminas-skeleton-appliacation/1491)

<div class="topic-metadata">

**Author:** [@Sergi\_Garcia\_Besora](https://discourse.laminas.dev/u/Sergi_Garcia_Besora)\
**Replies:** 9\
**Last updated:** [April 10, 2020, 6:26pm UTC](https://discourse.laminas.dev/t/unit-testing-laminas-skeleton-appliacation/1491 "2020-04-10T18:26:59Z")

</div>

Hi, Does anyone test the skeleton application, I did and I get a Segmentation fault (core dumped) error, which is difficult for me to relove :thinking: I did what the tutorial points: composer require --dev laminas/la…

---

## [Phpunit using zend framework 3 and doctrine, Mocking not working](https://discourse.laminas.dev/t/phpunit-using-zend-framework-3-and-doctrine-mocking-not-working/937)

<div class="topic-metadata">

**Author:** [@shoebaamir7](https://discourse.laminas.dev/u/shoebaamir7)\
**Replies:** 4\
**Last updated:** [February 11, 2019, 8:41am UTC](https://discourse.laminas.dev/t/phpunit-using-zend-framework-3-and-doctrine-mocking-not-working/937 "2019-02-11T08:41:56Z")

</div>

I’m using zend-test in zf3, using doctrine, when I run the test for PostController showAction(), it is showing following error $ vendor/bin/phpunit --testsuite Post --stderr PHPUnit 7.5.2 by Sebastian Bergmann and contr…

---

## [Unit testing with session](https://discourse.laminas.dev/t/unit-testing-with-session/742)

<div class="topic-metadata">

**Author:** [@jbelien](https://discourse.laminas.dev/u/jbelien)\
**Replies:** 5\
**Last updated:** [September 21, 2018, 8:50am UTC](https://discourse.laminas.dev/t/unit-testing-with-session/742 "2018-09-21T08:50:06Z")

</div>

Hello everyone, I’m rather new to unit testing (better late than never ^^) and I started using PHPUnit based on Zend Expressive skeleton. I analyzed the 3 available tests and understood how it works. But my applicatio…

---

## [$this-\>assert\* vs self::assert\*](https://discourse.laminas.dev/t/this-assert-vs-self-assert/448)

<div class="topic-metadata">

**Author:** [@xtreamwayz](https://discourse.laminas.dev/u/xtreamwayz)\
**Replies:** 33\
**Last updated:** [February 9, 2018, 2:08pm UTC](https://discourse.laminas.dev/t/this-assert-vs-self-assert/448 "2018-02-09T14:08:24Z")

</div>

The assertion methods are declared static and can be invoked from any context using PHPUnit\\Framework\\Assert::assertTrue(), for instance, or using $this-\>assertTrue() or self::assertTrue(), for instance, in a class that…

---

## [Zend\\Test for PHPUnit 7.x](https://discourse.laminas.dev/t/zend-test-for-phpunit-7-x/556)

<div class="topic-metadata">

**Author:** [@Ehrenstein](https://discourse.laminas.dev/u/Ehrenstein)\
**Replies:** 2\
**Last updated:** [April 6, 2018, 12:05pm UTC](https://discourse.laminas.dev/t/zend-test-for-phpunit-7-x/556 "2018-04-06T12:05:26Z")

</div>

Hey there, PHPUnit has evolved into version 7.x, but I can’t use that version when using Zend\\Test. Is there any roadmap when PHPUnit 7 will be supported?
