Skip to content
This repository has been archived by the owner on Aug 20, 2018. It is now read-only.

checkRedirect fails while using subdomains #43

Open
radekhubner opened this issue Apr 22, 2017 · 0 comments
Open

checkRedirect fails while using subdomains #43

radekhubner opened this issue Apr 22, 2017 · 0 comments
Labels

Comments

@radekhubner
Copy link
Contributor

I have a app where modules are subdomains bun In testbench TPresenter:185 is static domain.

Router:

 $router = new RouteList;

 $appRouter = new RouteList('App');
 $appRouter[] = new Route('//app.%domain%/<presenter>/<action>', 'Homepage:default');
 $router[] = $appRouter;

 $webRouter = new RouteList('Web');
 $webRouter[] = new Route('//www.%domain%/<presenter>/<action>', 'Homepage:default');
 $webRouter[] = new Route('<presenter>/<action>', 'Homepage:default');
 $router[] = $webRouter;

 return $router;

Presenter action:

public function actionOut(): void
{
    $this->getUser()->logout();
    $this->redirect('Homepage:');
}

Test:

public function testActionOut()
{
    $user = $this->logIn(1);

    Assert::equal(1, $user->getId());
    Assert::true($user->isLoggedIn());

    $this->checkRedirect(':App:Sign:out', '/');

    Assert::equal(1, $user->getId());
    Assert::false($user->isLoggedIn());
 }

Error:
Failed: path '/' doesn't match 'http://app.test.bench/' after redirect in testActionOut()

@mrtnzlml mrtnzlml self-assigned this Apr 24, 2017
@mrtnzlml mrtnzlml added the bug label Apr 24, 2017
@mrtnzlml mrtnzlml removed their assignment Nov 23, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants