im using behat to test my symfony2 projects specifically a test project i have to be a sandbox for my bundles.
One of the bundles to test is my FacebookBundle that integrate facebook api into symfony2 projects. This bundle provide several twig extensions. In the authenticate url of the bundles project i use one of this twig extensions to render the facebook login url but when i test it with behat i get this error:
An exception has been thrown during the rendering of a template ("Notice: Undefined index: HTTP_HOST in /var/www/vendor/facebook/php-sdk/src/base_facebook.php line 1187") in TestBundle:Default:auth.html.twig at line 13.
But i dont see any reason why this is happening, the project work just fine but testing with behat faild.
Any help, thanks
EDIT
Extrange im testing this project on travis and there all behat test pass, see travis: travis-ci.org/bitgandtter/bundles/jobs/37200512
EDIT2
It seams only happend with symfony2 driver for mink, i chage to goutte and work just fine, i review the code and symfony2 driver extend from mink-browse-kit driver, it will be nice to have some configuration options over it, i will keep digging to find the issue
Related
I'm trying to integrate a legacy application in symfony fullstack.
Because of poor infrastructure I have to stick to symfony 2.8.
Everything works so far, but i think i maybe have a problem with sessions.
(I read the symfony articles about integrating legacy sessions and tried everything)
The Toolbar says "You are not authenticated".
Normally there is "Authenticated anonymously".
This is how it should look.
(Screen from a plain install of symfony2.8 in the exact same version i use)
What are possible reasons for that?
Thanks for your help.
Somehow the legacy application failed and directly rendered a response from within an event listener. I can't really explain it, but now it works.
I installed Laravel-4 on my MAC, its all good until i try to do something.
I tried to follow the tutorial on website, which is the basic route here http://laravel.com/docs/quick
When i tried to open, its an error with message: Class Route not found on routes.php
I barely use framework PHP, so should i make a class for it or what do they want?
Is there another way to test that i could use the Laravel-4 php , like the hello-world ?
I am learning Laravel. With composer i included the mobile-detect-bundle in the installation (files are in the folders). When i use the code as stated in the docs on github
$mobileDetector = $this->get('mobile_detect.mobile_detector');
i get this error:
**ErrorException**
File does not exist at path mobile_detect.mobile_detector (View: ) (View: )
I use this in my blade view and i think i have to set the path of 'mobile_detect.mobile_detector' but i have no clue what it has to be. Maybe one can give me a push in the right direction?
The reason it's not working is because you are trying to use a Symfony 2 bundle inside Laravel right out of the box.
As the github page says:
Symfony2 bundle for detect mobile devices, manage mobile view and redirect to the mobile and tablet version.
Basically, the line that you are trying to run is the way that you use services inside Symfony. It will work if you are in a Symfony application, but not inside Laravel.
// Get the mobile_detect.mobile_detector
// service from Symfony's service container
$mobileDetector = $this->get('mobile_detect.mobile_detector');
Although there might be some way to make it work, I'd sugggest to search in packagist for a Laravel specific package, or a PHP generic one that provides the same functionality, to make your life easier.
I've made a search and found this one, which is based in Mobile Detect too:
https://github.com/jenssegers/Laravel-Agent
Although we had some difficulties, we finally achieved to make our Symfony 1.4 application work fine in App Engine.
However, we are experiencing a problem related to the routes in Symfony.
From App Engine SDK (localhost) everything works perfect. If we access the URL:
http://localhost:9080/user/create
The parameters "user" and "create" are automatically detected by symfony as the "module" and "action" variables.
But when the application is deployed in App Engine, the same route /user/create does not work. Symfony shows an error message indicating that both the module and action parameters are empty.
Any idea of why these two environments have different behavior or how could it be fixed to get it work in the same way as in App Engine?
I am using HMVC in my codeigniter project because use it help to group my modules together so that code is better organized.
When I integrate CIunit with codeigniter by following kenjis tutorials from How to use PHPUnit (CIUnit) with CodeIgniter 2.1.0, I got error when I try to run a test.
I get the following error:
[CIUnit] PHP Error: Notice - Trying to get property of non-object File Path: MX/Loader.php (line: 48)
PHP Fatal error: Call to a member function fetch_module() on a non-object in E:\xampp\htdocs\Project\application\third_party\MX\Loader.php on line 48
I read kenjis comments from CIUnit + HMVC Issue.
However, he says it's "ugly", not "impossible" to integrate them. Has anyone done this integration and gotten CIUnit and HMVC to work together?
Thanks in advance.
From my understanding, each module is a mini version of whole CodeIgniter framework. It seems possible to me that you
Set up a CIUnit testing environment with a fresh framework
Add one module's files to corresponding folders
Do testing
Repeat for each module
It would be tedious and time-consuming to set up testing environment for each module at first. But once you set them up, you will be able to test each module without modifying any core files.