Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin login fails when WordPress core is in a subdirectory #44

Open
ataylorme opened this issue Apr 20, 2017 · 8 comments
Open

Admin login fails when WordPress core is in a subdirectory #44

ataylorme opened this issue Apr 20, 2017 · 8 comments

Comments

@ataylorme
Copy link

Specifically the $this->minkContext->assertPageAddress("wp-admin/"); assertion fails.

We should pull the WordPress core URL with wp option get siteurl and append wp-admin.

@stevector
Copy link
Collaborator

Yeah, we can override MinkContext to alter the handling of admin urls by assertPageAddress()

@ataylorme
Copy link
Author

Cool, let's look into it at Drupalcon or when you are back. It's currently blocking work for me on my advanced WordPress demo repo running these tests since core is install in the wp subdirectory so the admin URLs are wp/wp-admin

@stevector
Copy link
Collaborator

I'm working on addressing this problem. I've been combining this repo and https://github.com/pantheon-systems/example-drops-8-composer into https://github.com/stevector/example-wordpress-composer such that it can be built from https://github.com/pantheon-systems/terminus-build-tools-plugin

I have gotten to the point where at least a hacked branch of our tests can pass: #47 by setting the base url to include /wp: https://github.com/stevector/example-wordpress-composer/blob/bd0ea1302b744d6f01e6f39bf000da7155c1683d/tests/scripts/run-behat#L18

@stevector
Copy link
Collaborator

Here is a repo that was created by me running

terminus build-env:create-project stevector/example-wordpress-composer persch-ewc-m --stability=dev --yes

https://github.com/stevector/persch-ewc-m

As the name suggests, persch-ewc-a through persch-ewc-l all failed in one way or another. Next I need to update: pantheon-systems/terminus-build-tools-plugin#9

@ataylorme
Copy link
Author

@stevector I think we can take a lesson from WordHat here. They pull the admin URL from SITE_URL, which has to be updated to the correct path when putting WordPress core in a subdirectory.

See src/Context/RawWordpressContext.php in WordHat

@stevector
Copy link
Collaborator

Thanks for finding that method @ataylorme! I'll adapt that method into our suite until we can do a fuller rewrite relying on WordHat.

@ataylorme
Copy link
Author

until we can do a fuller rewrite relying on WordHat.

@stevector do you still think this is something we should do? I have a lot more Behat/Wordhat experience than I did 2 years ago 😄

@stevector
Copy link
Collaborator

lol, maybe @ataylorme. But it probably doesn't take precedent over Build Tools work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants