Symfony2 Behat Extending Contexts will result in "Step is already defined"
<p>I am trying to write some Behat tests for an application and I need to separate the Contexts so I can use some core elements in different other contexts for example the logged in user step.</p>

<blockquote>
  <p>behat.yml</p>
</blockquote>

<pre><code>suites:
    common:
        type: symfony_bundle
        bundle: CommonBundle
        mink_session: symfony2
        mink_javascript_session: selenium2
        autoload:
            'CommonContext': %paths.base%/src/xxx/CommonBundle/Features/Context
        contexts: [ xxx\CommonBundle\Features\Context\CoreContext ]

    user:
        type: symfony_bundle
        bundle: UserBundle
        mink_session: symfony2
        mink_javascript_session: selenium2
        autoload:
            'UserContext': %paths.base%/src/xxx/UserBundle/Features/Context
        contexts:
            - Behat\MinkExtension\Context\MinkContext
            - xxx\CommonBundle\Features\Context\CoreContext
            - xxx\UserBundle\Features\Context\UserContext
</code></pre>

<blockquote>
  <p>DefaultContext.php</p>
</blockquote>

<pre><code>namespace XXX\CommonBundle\Features\Context;

use ...

/**
 * Class DefaultContext
 */
class DefaultContext extends MinkContext implements Context, KernelAwareContext
{

    /**
     * @param AbstractEntity $oEntity
     *
     * @return object
     */
    protected function getRepository(AbstractEntity $oEntity)
    {
        return $this-&gt;getService($oEntity);
    }

    /**
     * @return mixed
     */
    protected function getEntityManager()
    {
        return $this-&gt;getService('doctrine')-&gt;getManager();
    }

    /**
     * @param $id
     *
     * @return object
     */
    protected function getService($id)
    {
        return $this-&gt;getContainer()-&gt;get($id);
    }
</code></pre>

<blockquote>
  <p>CoreContext.php</p>
</blockquote>

<pre><code>namespace XXX\CommonBundle\Features\Context;

use ...

/**
 * Class SubContext
 */
class CoreContext extends DefaultContext implements Context, SnippetAcceptingContext
{

    /**
     * @Given I visit the homepage
     * @When I visit the homepage
     */
    public function iVisitHomepage()
    {
        $this-&gt;visitPath('/');
    }

    /**
     * @And /^I am logged in as "([^"]*)"$/
     * @Then /^I am logged in as "([^"]*)"$/
     */
    public function iAmLoggedInAs($username)
    {
        $user = $this-&gt;getContainer()-&gt;get('fos_user.user_manager')-&gt;findUserByUsername($username);

        $this-&gt;visit('/login');

        $this-&gt;fillField('_username', $user-&gt;getEmailCanonical());
        $this-&gt;fillField('_password', self::USER_PASSWORD);

        $this-&gt;pressButton('_submit');
    }
</code></pre>

<blockquote>
  <p>UserContext.php</p>
</blockquote>

<pre><code>namespace xxx\UserBundle\Features\Context;

use ...

/**
 * Defines application features from the specific context.
 */
class UserContext extends CoreContext implements Context, SnippetAcceptingContext
{

    /**
     * Initializes context.
     *
     * Every scenario gets its own context instance.
     * You can also pass arbitrary arguments to the
     * context constructor through behat.yml.
     */
    public function __construct()
    {
    }

}
</code></pre>

<blockquote>
  <p>register_user.feature</p>
</blockquote>

<pre><code>Feature: Register user

  @javascript
  Scenario: Register user
    Given I am on homepage
    And I go to "/register/"
    And I am logged in as "foo@bar.com"
    Then I should see "Terms and Conditions"
</code></pre>

<p>So when I run the test I get an error saying this:</p>

<pre><code>Given I am on homepage
      Step "I visit the homepage" is already defined in xxx\CommonBundle\Features\Context\CoreContext::iVisitHomepage()

      xxx\CommonBundle\Features\Context\CoreContext::iVisitHomepage()
      xxx\CommonBundle\Features\Context\CoreContext::iVisitHomepage()
    And I go to "/register/"
      Step "I visit the homepage" is already defined in xxx\CommonBundle\Features\Context\CoreContext::iVisitHomepage()

      xxx\CommonBundle\Features\Context\CoreContext::iVisitHomepage()
      xxx\CommonBundle\Features\Context\CoreContext::iVisitHomepage()
</code></pre>

<p>Do i understood this completely wrong or I am missing some settings here?</p>