News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Sebastian Göttschkes:
symfony2 Testing secure pages
October 08, 2012 @ 13:13:19

Sebastian Göttschkes has a new post to his site showing you how to test secure pages within your Symfony2 applications using a simple "requestWithAuth" method.

If you develop a web application, more often than not you have some kind of user section or admin panel where some kind of login identifies the user and protects your actions against usage from unauthorized people. It can be difficult to do functional tests with this kind of pages as you need to simulate some session or cookie context. In this tutorial, I want to show you how to test your functional pages with symfony2 and phpunit.

He includes a "bad way" to do it, cheating by making a client and feeding it the HTTP auth credentials, and a more correct way involving the "requestWithAuth" method that's called whenever the "request" is called to push those credentials along with every request. Code for this basic function is included.

0 comments voice your opinion now!
symfony2 testing unittest authentication http auth tutorial


blog comments powered by Disqus

Similar Posts

NetTuts.com: Quick Tip: Integrate Compass into an Existing CodeIgniter

DevShed: Working with Private Properties to Protect PHP 5 Class Data

Jani Hartikainen's Blog: What is a null object, and when are they useful?

Developer.com: Amazon Web Services and the Zend Framework

HowToForge.com: Installing Cherokee With PHP5 And MySQL Support On Ubuntu 11.04


Community Events





Don't see your event here?
Let us know!


configure series threedevsandamaybe interview code testing laravel unittest list developer wordpress opinion framework release install introduction community podcast language experience

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework