pantheon-systems / pantheon-wordpress-upstream-tests

Tests behavior of WordPress Core upstreams for Pantheon. Also within test suites of contrib plugins
MIT License
15 stars 6 forks source link

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

Open ataylorme opened 7 years ago

ataylorme commented 7 years ago

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 commented 7 years ago

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

ataylorme commented 7 years ago

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 commented 7 years ago

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: https://github.com/pantheon-systems/pantheon-wordpress-upstream-tests/pull/47 by setting the base url to include /wp: https://github.com/stevector/example-wordpress-composer/blob/bd0ea1302b744d6f01e6f39bf000da7155c1683d/tests/scripts/run-behat#L18

stevector commented 7 years ago

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: https://github.com/pantheon-systems/terminus-build-tools-plugin/pull/9

ataylorme commented 7 years ago

@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 commented 7 years ago

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 commented 5 years ago

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 commented 5 years ago

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