Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8166231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:47:18+00:00 2026-06-06T19:47:18+00:00

I’m trying to run Symfony 2 PHP unit tests for a REST API in

  • 0

I’m trying to run Symfony 2 PHP unit tests for a REST API in a custom environment, other than the default ‘test’ environment.

The purpose is to be able to do a quick sanity check after deploying the rest API, in any environment (e.g. int, prod)

I managed to pass the environment to the WebTestCase class, when creating a new kernel/client.
My problem is that I’m now getting the following error:

“The session id is too long or contains illegal characters, valid characters are a-z, A-Z, 0-9”

I can fix that by changing the session storage to filesystem in the config.[targetenvironment].yml, but I don’t want to use filesystem storage when in prod for instance.

framework:
    test: ~
    session:
        storage_id: session.storage.filesystem

Is there any way around this issue?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T19:47:20+00:00Added an answer on June 6, 2026 at 7:47 pm

    In chapter 11 of the PHPUnit manual there is a section on mocking the filesystem. This basically intercepts all filesystem calls, so making sure the test you run has no side-effects. This should solve your problem if you’re calling functions directly (i.e if the php instance running PHPUnit is also the one running your code).

    If, however, your calls are going through the web server then PHPUnit configuration cannot control the remote environment. In that case you could try a special Apache configuration that sets an environmental variable based on the clients IP address and/or user-agent string and then in your code use that environmental variable to override the default session storage, or anything else you need to.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm trying to create an if statement in PHP that prevents a single post
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
this is what i have right now Drawing an RSS feed into the php,
I am trying to render a haml file in a javascript response like so:
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.