sensiolabs/BehatPageObjectExtension — pull request #23 by mjsilva (2014-04-08 10:35:24+00:00)
Title: Added getter for PageFactory

I need Pages Object to belong to two different websites and its classes sit on separate namespaces. So I need to be able to overwrite the namespace on @BeforeScenario.

Since pageFactory is a private property I had no way to redefine it on runtime, to circumvent that I added a getter so I can change a re-set it after.

Usage example
````php
/**
* @BeforeScenario @alice
*/
public function visitAlice()
{
$pageFactory = $this->getPageFactory();
$pageFactory->setPageNamespace(static::PAGE_NAMESPACE_ALICE);
$this->setPageFactory($pageFactory);

/** @var \Behat\Context\Shared\NavigationContext $navigationContext */
$navigationContext = $this->getSubcontext('NavigationContext');
$navigationContext->visitSite("Alice");
}

/**
* @BeforeScenario @bob
*/
public function visitBob()
{
$pageFactory = $this->getPageFactory();
$pageFactory->setPageNamespace(static::PAGE_NAMESPACE_BOB);
$this->setPageFactory($pageFactory);

/** @var \Behat\Context\Shared\NavigationContext $navigationContext */
$navigationContext = $this->getSubcontext('NavigationContext');
$navigationContext->visitSite("Bob");
}
````