Skip to content

Conversation

@karrirasinmaki
Copy link

This pull request will fix local paths given by function beans_url_to_path(string) on some environments.

The problem arose, fixed and tested on this WP Vagrant box:
https://github.com/Seravo/wordpress

@christophherr
Copy link
Member

Hey @karrirasinmaki,
thank you for contributing to Beans.

Can you please update your branch? It is 904 commits behind causing a merge conflict.

Does this problem exist in Beans 1.5.1?
What environments have this problem?
Our tests pass on Linux(Travis CI), Mac and Windows.

Running our test suite (on Windows) shows that this change would break things.

1) Beans\Framework\Tests\Unit\API\Utilities\Tests_BeansUrlToPath::test_should_bail_out_when_external_url
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-http://www.example.com/image.png
+./http:/www.example.com/image.png

C:\laragon\www\beans\wp-content\themes\Beans\tests\phpunit\unit\api\utilities\beansUrlToPath.php:50

2) Beans\Framework\Tests\Unit\API\Utilities\Tests_BeansUrlToPath::test_should_convert_domain_url
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-/laragon/www/beans
+./http:/foo.com/

C:\laragon\www\beans\wp-content\themes\Beans\tests\phpunit\unit\api\utilities\beansUrlToPath.php:113

3) Beans\Framework\Tests\Unit\API\Utilities\Tests_BeansUrlToPath::test_should_convert_ip_for_subdirectory_multisiteFailed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-/laragon/www/beans/image.png
+./http:/50.50.50.50/shop/image.png

C:\laragon\www\beans\wp-content\themes\Beans\tests\phpunit\unit\api\utilities\beansUrlToPath.php:345

4) Beans\Framework\Tests\Unit\API\Utilities\Tests_BeansUrlToPath::test_should_convert_ip_for_subdomain_multisite
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-/laragon/www/beans/image.jpg
+./http:/shop.1.2.3.4/image.jpg

C:\laragon\www\beans\wp-content\themes\Beans\tests\phpunit\unit\api\utilities\beansUrlToPath.php:375

@karrirasinmaki
Copy link
Author

Let me take a better look on this after syncing up with the current version.

@karrirasinmaki
Copy link
Author

Hi,

the problem exists till in Bean 1.5.1.

This PR got changes so much it was hard for me to sync upstream to my fork. So I created new PR out of my fork's master branch from where I initially made that fix.

#328

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

Successfully merging this pull request may close these issues.

3 participants