Codeception: file_put_contents fails when there is a colon in filename

Created on 11 Jun 2016  路  3Comments  路  Source: Codeception/Codeception

It seems that file_put_contents does not like semicolons in filename.

[PHPUnit_Framework_Exception]
file_put_contents(/var/www/tests/codeception/frontend/_output/tests.codeception.frontend.acceptance.SignupCest:testUserSignup.fail.html): failed to open stream: Protocol error

If I change str_replace at method _failed() in /src/Codeception/Lib/InnerBrowser.php so that single colons will be replaced instead of double colons then everything works fine.

System:

PHP 5.6.20-1~dotdeb+7.1 (cli) (built: Apr 1 2016 04:14:49)
Linux 3.2.0-4-amd64 #1 SMP Debian 3.2.68-1+deb7u6 x86_64 GNU/Linux

BUG

Most helpful comment

+1

I'm having the same issue : failed to open stream: Protocol error. I think this is related to Windows not allowing colon in file names. I run a Linux VM on my workstation (Windows 7) and my project is in a shared folder between my Windows host and the VM. Codeception tries to create a file in that folder with a colon when a test fails, but it then throws this exception.

All 3 comments

+1

I'm having the same issue : failed to open stream: Protocol error. I think this is related to Windows not allowing colon in file names. I run a Linux VM on my workstation (Windows 7) and my project is in a shared folder between my Windows host and the VM. Codeception tries to create a file in that folder with a colon when a test fails, but it then throws this exception.

I have same setup. Windows host that runs Linux VM and project folder is shared.

+1

Same issue: Windows host, Linux VM, shared project folder

Was this page helpful?
0 / 5 - 0 ratings