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 6050033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:38:36+00:00 2026-05-23T07:38:36+00:00

I am looking for a (small) library that helps me cleanly implement a front

  • 0

I am looking for a (small) library that helps me cleanly implement a front controller for my pet project and dispatches requests to single controller classes. The front controller/dispatcher and controller classes need to be fully unittestable without sending HTTP requests.

Requirements

  • PSR-0 compatible
  • installable via its own PEAR channel
  • support for unit testing:
    • checking if the correct HTTP headers are sent
    • catches output to allow inspection in unit tests
    • perferably PHPUnit helper methods to help inspecting the output (for different output types, i.e. HTML, XML, JSON)
    • allows setting of incoming HTTP headers, GET and POST parameters and cookies without actually doing HTTP requests
  • needs to be usable standalone – without the db abstraction, templating and so that the fat frameworks all provide

Background

SemanticScuttle, the application that is bound to get proper “C” support, is an existing, working application. The library needs to blend in it and needs to work with the existing structure and classes. I won’t rewrite it to match a framework’s specific required directory layout.

The application already has unittests, but based on HTTP requests which make them slow. Also, the current old way of having several dozens of .php files in the www directory isn’t the most managable solution, which is why proper controller classes need to be introduced. All in all, there will be about 20-30 controllers.

Previous experience

In general, I was pretty happy with Zend Framework for some previous projects but it has several drawbacks:

  • not pear-installable, so I cannot use it as dependency in my pear-installble applications
  • only available as one fat download, so I manually need to extract the required bits from it – for each single ZF update.
  • while unit test support exists for ZF controllers, it’s lacking some advanced utility functionality like assertions for json, HTTP status code and content type checks.

While these points seem to be nit-picking, they are important for me. If I have to implement them myself, I do not need to use an external libary but write my own.

What I don’t want

StackOverflow has a million “what’s the best PHP framework” questions (1, 2, 3, 4, 5), but I’m not looking for those but for a specific library that helps with controllers. If it’s part of a modular framework, fine.

I also know the PHP framework comparison website, but it doesn’t help answer my question since my requirements are not listed there.

And I know that I can build this all on my own and invent another microframework. But why? There are so many of them already, and one just has to have all that I need.

Related questions

  • What’s your ‘no framework’ PHP framework?
  • How do you convert a page-based PHP application to MVC?
  • 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-05-23T07:38:37+00:00Added an answer on May 23, 2026 at 7:38 am

    Knowing Symfony2 well, I can assure you it’s definitely possible to use it just for the “C” in MVC. The models and templates are completely free and are typically executed from the Controllers anyway, so if you don’t call Doctrine or Twig specifically, you can do what you want.

    As for functional testing, which is really what you’re talking about in your article, what you want to look at is the WebTestCase class, which is well complemented by the LiipFunctionalTestBundle bundle for more advanced cases.

    That allows for some things like this example of testing a contact form that sends an email, where the entire HTTP request is done in process, since the framework is written to allow multiple requests per process and has no global state, this works very well and does not require a http server to be running or anything. As you can see I do assertions on the HTTP status code of the response too, and was able to capture the email without sending it since in test configuration sending of emails is disabled in the standard distro of Symfony2.

    That being said, you could also just use the Request and Response classes from Symfony2’s HttpFoundation component. It should allow you to test your code, but IMO you wouldn’t get as many nice features as you could if you’d use the entire framework. Of course that’s just my biased opinion 😉

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

Sidebar

Related Questions

No related questions found

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.