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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:06:43+00:00 2026-06-10T02:06:43+00:00

I have recently started using Behat with Mink on a PHP project that uses

  • 0

I have recently started using Behat with Mink on a PHP project that uses the Slim microframework My Behat tests work fine but I would like to run them as part of my build, which uses the Jenkins-PHP template by Sebastian Bergmann.

To do this, I expect that I would need to run a web server to serve the Slim app. The obvious answer would seem to be PHP 5.4’s built in web server, but I am restricted to PHP 5.3.

The only idea I have at the moment is to have a deploy phase whereby if the Ant build passes, Jenkins deploys a workspace on a server and then runs the Behat tests against that. This feels like it would be a lot of work and could be flaky, plus it would require spinning up another VM, which I’d prefer to avoid. We are looking to employ Behat across a large number of diverse projects so something “disposable” would be preferable.

What is the best way of solving this issue?

  • 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-10T02:06:45+00:00Added an answer on June 10, 2026 at 2:06 am

    The solution we went with in the end is much like Jakub suggested – our Jenkins instance generates Apache vhost files in conf.d for each workspace that uses Behat, using a script something like the following:

    # Set up a host file entry if none exists
    hostFileEntry="127.0.0.1 ${JOB_NAME}.loc"
    if fgrep -i "$hostFileEntry" /etc/hosts
    then
            echo "${hostFileEntry}" already in hosts file
    else
            echo $hostFileEntry >> /etc/hosts
    fi
    
    # Set up a virtual host for this job
    echo "<VirtualHost *:80>" > /etc/httpd/conf.d/${JOB_NAME}.conf
    echo "    ServerName ${JOB_NAME}.loc" >> /etc/httpd/conf.d/${JOB_NAME}.conf
    echo "    DocumentRoot ${WORKSPACE}/public" >> /etc/httpd/conf.d/${JOB_NAME}.conf
    echo "        <Directory ${WORKSPACE}/public>" >> /etc/httpd/conf.d/${JOB_NAME}.conf
    echo "            AllowOverride all" >> /etc/httpd/conf.d/${JOB_NAME}.conf
    echo "            Order allow,deny" >> /etc/httpd/conf.d/${JOB_NAME}.conf
    echo "            Allow from all" >> /etc/httpd/conf.d/${JOB_NAME}.conf
    echo "        </Directory>" >> /etc/httpd/conf.d/${JOB_NAME}.conf
    echo "</VirtualHost>" >> /etc/httpd/conf.d/${JOB_NAME}.conf
    
    # Reload Apache
    sudo /sbin/service httpd reload
    

    We then run Behat against these workspaces and output in JUnit format to integrate the results with our builds. It required some tweaking of permissions, but this is working very nicely for us, so many thanks for your help 🙂

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

Sidebar

Related Questions

I have recently started to learn Objective-C and write my tests using OCUnit that
I have recently started using automapper and it has work fine for me so
I have recently started using PlayN for a hobby project and has now stumbled
I have recently started using a shared-host for my clients so see project progress
I have recently started using coffeescript with Rails and I am finding that sometimes
I have recently started to learn using of Doctrine 2.0 framework for PHP. Now
Ive recently started using Ruby on Rails for a project of mine and have
I've just recently started using VS2008 for a new tools project, and have been
I have recently started using generics in java, and in that attempt tried to
I recently started using WPF and the MVVM framework, one thing that I have

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.