# \#laminas-test

**URL:** https://discourse.laminas.dev/tag/laminas-test/58.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…

---

## [Is laminas-test dead?](https://discourse.laminas.dev/t/is-laminas-test-dead/3764)

<div class="topic-metadata">

**Author:** [@sw1024](https://discourse.laminas.dev/u/sw1024)\
**Replies:** 3\
**Last updated:** [September 18, 2024, 12:18am UTC](https://discourse.laminas.dev/t/is-laminas-test-dead/3764 "2024-09-18T00:18:54Z")

</div>

Hello everyone, I have posted an issue about two weeks ago on the git hub page of laminas-test but no response till now. That is why I’m asking if this project is dead. This was the issue which I had opened → Testing o…

---

## [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…

---

## [Unit test failing for the paginated module](https://discourse.laminas.dev/t/unit-test-failing-for-the-paginated-module/3593)

<div class="topic-metadata">

**Author:** [@vrkansagara](https://discourse.laminas.dev/u/vrkansagara)\
**Replies:** 4\
**Last updated:** [February 12, 2024, 10:11am UTC](https://discourse.laminas.dev/t/unit-test-failing-for-the-paginated-module/3593 "2024-02-12T10:11:55Z")

</div>

I was trying to follow this tutorial with the pagination + unit test , it is failing and not sure how to fix it. Can any one help me . thanks in advance AlbumController.php \<?php namespace Album\\Controller; use …

---

## [Different config per EACH test in onBoostrap](https://discourse.laminas.dev/t/different-config-per-each-test-in-onboostrap/3381)

<div class="topic-metadata">

**Author:** [@lon9man](https://discourse.laminas.dev/u/lon9man)\
**Replies:** 3\
**Last updated:** [June 28, 2023, 10:43am UTC](https://discourse.laminas.dev/t/different-config-per-each-test-in-onboostrap/3381 "2023-06-28T10:43:01Z")

</div>

hello, trying to test live controller with minimal mocking. basic situation using simple words: we have config for multiple adapters, which will be used by vendor-FooService in onBootstrap FooService takes this confi…

---

## [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 : …

---

## [Reset application loop/event manager during tests](https://discourse.laminas.dev/t/reset-application-loop-event-manager-during-tests/2976)

<div class="topic-metadata">

**Author:** [@Jurigag](https://discourse.laminas.dev/u/Jurigag)\
**Replies:** 6\
**Last updated:** [August 2, 2022, 3:23pm UTC](https://discourse.laminas.dev/t/reset-application-loop-event-manager-during-tests/2976 "2022-08-02T15:23:42Z")

</div>

So we have currently end to end tests using real http client which are really slow. I wanted to switch them to use laminas/laminas-test but we test cases making many requests in one test, and it doesn’t seem to be workin…

---

## [Ini\_set() return false and failed in laminas and PHP8](https://discourse.laminas.dev/t/ini-set-return-false-and-failed-in-laminas-and-php8/2864)

<div class="topic-metadata">

**Author:** [@ali.alinezhad](https://discourse.laminas.dev/u/ali.alinezhad)\
**Replies:** 5\
**Last updated:** [June 17, 2022, 11:38am UTC](https://discourse.laminas.dev/t/ini-set-return-false-and-failed-in-laminas-and-php8/2864 "2022-06-17T11:38:15Z")

</div>

I have recently updated a zend project to Laminas and PHP8. It seems it works, but integration test is failed because ini\_set() return false here. \\Laminas\\Session\\Config\\SessionConfig::setStorageOption I saw this warn…

---

## [How to replace EventManager of Controller with mock in Test?](https://discourse.laminas.dev/t/how-to-replace-eventmanager-of-controller-with-mock-in-test/2851)

<div class="topic-metadata">

**Author:** [@rarog](https://discourse.laminas.dev/u/rarog)\
**Replies:** 1\
**Last updated:** [April 17, 2022, 12:25pm UTC](https://discourse.laminas.dev/t/how-to-replace-eventmanager-of-controller-with-mock-in-test/2851 "2022-04-17T12:25:53Z")

</div>

So far it looks to me that the event manager is created on the fly and a call to getControllerFullClass() to retrieve the class object would be too late as by this time the event has already be fired.

---

## [How to retrieve all available routes in an application?](https://discourse.laminas.dev/t/how-to-retrieve-all-available-routes-in-an-application/2668)

<div class="topic-metadata">

**Author:** [@Koen1999](https://discourse.laminas.dev/u/Koen1999)\
**Replies:** 0\
**Last updated:** [December 24, 2021, 1:43pm UTC](https://discourse.laminas.dev/t/how-to-retrieve-all-available-routes-in-an-application/2668 "2021-12-24T13:43:22Z")

</div>

I want to quickly improve test coverage for my project by doing some basic tests. In specific, I had the idea to test whether all Controller actions return a non-500 status code since this is something that all actions s…

---

## [How to write Controller tests for actions requiring authentication?](https://discourse.laminas.dev/t/how-to-write-controller-tests-for-actions-requiring-authentication/2667)

<div class="topic-metadata">

**Author:** [@Koen1999](https://discourse.laminas.dev/u/Koen1999)\
**Replies:** 0\
**Last updated:** [December 24, 2021, 1:35pm UTC](https://discourse.laminas.dev/t/how-to-write-controller-tests-for-actions-requiring-authentication/2667 "2021-12-24T13:35:46Z")

</div>

I haven’t been able to find any documentation regarding this while I think it is quite a common use case. Most websites have some form of authentication or access control and being able to test this could improve our wor…

---

## [QueryContentContains Assertion fails with "An unexpected failure occured"](https://discourse.laminas.dev/t/querycontentcontains-assertion-fails-with-an-unexpected-failure-occured/2397)

<div class="topic-metadata">

**Author:** [@makxk](https://discourse.laminas.dev/u/makxk)\
**Replies:** 2\
**Last updated:** [July 7, 2021, 9:31am UTC](https://discourse.laminas.dev/t/querycontentcontains-assertion-fails-with-an-unexpected-failure-occured/2397 "2021-07-07T09:31:37Z")

</div>

Hello everyone! I’ve been trying to write a test case for an application, which displays a login prompt on its indexAction. The goal of this test case is to succeed when the account is not found. I am testing for an er…

---

## [Testing Form with CSRF element](https://discourse.laminas.dev/t/testing-form-with-csrf-element/2232)

<div class="topic-metadata">

**Author:** [@smj320](https://discourse.laminas.dev/u/smj320)\
**Replies:** 2\
**Last updated:** [April 9, 2021, 1:32pm UTC](https://discourse.laminas.dev/t/testing-form-with-csrf-element/2232 "2021-04-09T13:32:42Z")

</div>

Hi. I tested a form with csrf elemnet, but failed. Get a page with $this-\>despach("/") Get returned html with $this-\>application-\>getResponse()-\>getContent(); Extact csrf’s value using DOM Post form with 3)'s crsf key…

---

## [How to test Controller with csrf element in Form](https://discourse.laminas.dev/t/how-to-test-controller-with-csrf-element-in-form/1786)

<div class="topic-metadata">

**Author:** [@Stavros\_Fassbender](https://discourse.laminas.dev/u/Stavros_Fassbender)\
**Replies:** 2\
**Last updated:** [August 25, 2020, 6:11am UTC](https://discourse.laminas.dev/t/how-to-test-controller-with-csrf-element-in-form/1786 "2020-08-25T06:11:48Z")

</div>

I am writing unittests for my controllers that also handle form-submits. everything is working fine so far. I am using the library laminas-test to dispatch the requests. Now I added a csrf-element to my form but I don’…

---

## [Configuration Override in Controller Tests](https://discourse.laminas.dev/t/configuration-override-in-controller-tests/1597)

<div class="topic-metadata">

**Author:** [@ryan](https://discourse.laminas.dev/u/ryan)\
**Replies:** 2\
**Last updated:** [May 13, 2020, 3:02pm UTC](https://discourse.laminas.dev/t/configuration-override-in-controller-tests/1597 "2020-05-13T15:02:33Z")

</div>

Hi All, I’ve recently started adding unit tests to a ZF application that I’ve taken over from a previous developer. Mostly this has gone well (with some refactoring & migrating to Laminas) however I’ve hit a small snag …
