Giter Club home page Giter Club logo

symfony-session-tests's Introduction

Symfony session handler test suite

This repository contains a test suite for the Symfony session save handlers (to test locking support). Current handlers that can be tested (and their corresponding test mode) are:

Note that the standard mode testable handlers implement strict mode as well, but can't be tested as strict handlers.

Requirements

You can install the dependencies of this script using:

sudo apt install php-cli php-curl

Optional dependencies can be installed using:

sudo apt install memcached php-memcached redis php-redis php-mysql

You can install the Symfony dependencies of this script using:

wget getcomposer.org/composer.phar
php composer.phar install

You need PHP 7.4 or higher to run the code.

Running the tests

You should prepare your MySQL database by running the SQL script:

cat create_mysql_symfony_session_test_db.sql | sudo mysql

You can run the tests from the command line using:

php run-tests.php

The code will execute in about 1 second per handler and test 104 HTTP calls for each handler. The following output would mean that the tests succeeded and locking is implemented correctly (which is not the case):

standard - default   : OK
strict   - pdo_mysql : OK
strict   - memcached : OK
strict   - redis     : OK

The word "FAILED" appears on a failed test and "SKIPPED" is shown when the PHP module is not loaded for either Redis or Memcache.

Stress testing

Use this for 100 runs:

for i in `seq 1 100`; do php run-tests.php silent; done

As shown, you may use the argument "silent" to suppress output on successful or skipped tests.

Links

Below you find some more interesting information about Symony, Sessions and locking:

Enjoy!

symfony-session-tests's People

Contributors

mevdschee avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.