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

  • Home
  • SEARCH
  • 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 8170167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T21:04:49+00:00 2026-06-06T21:04:49+00:00

We just started to unit-test our application for our CI; the first tests we

  • 0

We just started to unit-test our application for our CI; the first tests we have written run through, but PHPUnit always throws a error message at the end:

user@server:~/public$ phpunit -c app/ --strict src/Acme/Bundle/SomeBundle/Tests/Controller/SomeControllerTest.php 
PHPUnit 3.6.11 by Sebastian Bergmann.

Configuration read from /var/www/user/htdocs/public/app/phpunit.xml.dist

..

Time: 5 seconds, Memory: 130.00Mb

OO (2 tests, 2 assertions)
PHP Fatal error:  Exception thrown without a stack frame in Unknown on line 0
PHP Stack trace:
PHP   1. {main}() /usr/bin/phpunit:0
PHP   2. PHPUnit_TextUI_Command::main() /usr/bin/phpunit:46
PHP   3. PHPUnit_TextUI_Command->run() /usr/share/php/PHPUnit/TextUI/Command.php:133

Fatal error: Exception thrown without a stack frame in Unknown on line 0

Call Stack:
    0.0001     629992   1. {main}() /usr/bin/phpunit:0
    0.0023    1235832   2. PHPUnit_TextUI_Command::main() /usr/bin/phpunit:46
    0.0023    1236848   3. PHPUnit_TextUI_Command->run() /usr/share/php/PHPUnit/TextUI/Command.php:133

The only hint so far is that it only occurs if one (or more) of the tests uses [see below] to make a Request on the Page, so its is probably in some way session related.

$client = static::createClient();
$container = $client->getContainer();
$uri = $container->getParameter('url_frontend') . '/';
$client->request('GET', $uri);

Here is a link to our phpunit.xml.dist

Update:

I managed to get a little more information, about the error itself:

1) Acme\Bundle\SomeBundle\Tests\Controller\SomeControllerTest::testIndexResponseStatusCode
RuntimeException: PHP Fatal error:  Uncaught exception 'ErrorException' with message 'Warning: Unknown: Failed to write session data (user). Please verify that the current setting of session.save_path is correct (/tmp/sessions) in Unknown line 0' in /var/www/user/htdocs/public/vendor/symfony/src/Symfony/Component/HttpKernel/Debug/ErrorHandler.php:67
Stack trace:
#0 [internal function]: Symfony\Component\HttpKernel\Debug\ErrorHandler->handle(2, 'Unknown: Failed...', 'Unknown', 0, Array)
#1 {main}
  thrown in /var/www/user/htdocs/public/vendor/symfony/src/Symfony/Component/HttpKernel/Debug/ErrorHandler.php on line 67
  • 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-06T21:04:51+00:00Added an answer on June 6, 2026 at 9:04 pm

    One of our Developers (after much swearing and cursing) solved the Problem, at fault was the FOS\FacebookBundle\Facebook\FacebookSessionPersistence to be precise the fact that the constructor starts its own session:

    public function __construct($config, Session $session, $prefix = self::PREFIX)
    {
        $this->session = $session;
        $this->prefix  = $prefix;
        $this->session->start(); // he starts a session
    
        parent::__construct($config);
    }
    

    So we just wrote our own FacebookSessionPersistence Class:

    namespace Acme\Bundle\UserBundle\Facebook;
    
    use FOS\FacebookBundle\Facebook\FacebookSessionPersistence as BaseFacebookSessionPersistence;
    use Symfony\Component\HttpFoundation\Session;
    
    /**
     * Quick (and dirty) fix for running tests using FosFacebookBundle.
     * only use this class, while testing the application with phpunit
     *
     * @see https://github.com/FriendsOfSymfony/FOSFacebookBundle/issues/79
     */
    class FacebookSessionPersistence extends BaseFacebookSessionPersistence
    {
        public function __construct($config, Session $session, $prefix = self::PREFIX)
        {
            $this->session = $session;
            $this->prefix  = $prefix;
    
            // don't start session or call parent constructor
            //$this->session->start();
    
            //parent::__construct($config);
    
        }
    }
    

    And added it in the test config:

    # quick workaround as the fb class fails the test as it calls session->start in the construct   
    # @see https://github.com/FriendsOfSymfony/FOSFacebookBundle/issues/79
    fos_facebook:
        class:
            api: Acme\Bundle\UserBundle\Facebook\FacebookSessionPersistence   
    

    Hope that will help future generations…

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

Sidebar

Related Questions

I have just recently started carrying out unit testing for my software written in
Well, I'm new to unit-testing (with phpUnit) and just started to test one class
I just started out writing my first unit tests with JUnit and I ran
Just started my first MVC 2.0 .net application. And I set up some default
We use the APC user cache in our application, but I've started noticing various
We've just started using Sencha's ExtJS 4 in our project and have been following
I'm just getting started with Knockout JS and with QUnit for doing unit tests
I have an asp.net MVC project hosting a silverlight application. I just started rebuilding
We have a database against which we run unit tests for components that require
Just some days ago I started looking into a unit test framework called check,

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.