Closed tianhe1986 closed 7 years ago
@kenjis
I read your code and find you use IncludeStream as stream_wrapper, which caused is_writable problem.
Then I find deep into php source code and consider it to be a bug, and I report it(see here)
However, this pull request may still be right.
@tianhe1986 I have finally got a Windows 10 for testing. I would like to test it later.
@kenjis Thank you. You can also use linux with root user for testing.
I also got the following failures on Windows 10.
There were 2 failures:
1) CIPHPUnitTestFileCache_test::test_construct_fail_to_create_cache_file
Failed asserting that exception of type "RuntimeException" is thrown.
2) CIPHPUnitTestFileCache_test::test_construct_fail_to_create_dir
Failed asserting that exception of type "RuntimeException" is thrown.
@tianhe1986 I run your PR code on Windows 10, but I got an error:
A PHP Error was encountered
Severity: Warning
Message: rmdir(C:\...\ci-app-for-ci-phpunit-test\application\tests\_tests/tmp): Directory not empty
Filename: C:\Users\Kenji\work\ci-app-for-ci-phpunit-test\vendor\kenjis\ci-phpunit-test\application\tests\_ci_phpunit_test\patcher\IncludeStream.php
Line Number: 196
The test results:
There was 1 failure:
1) CIPHPUnitTestFileCache_test::test_construct_fail_to_create_dir
Failed asserting that exception of type "RuntimeException" is thrown.
--
There was 1 skipped test:
1) CIPHPUnitTestFileCache_test::test_construct_fail_to_create_cache_file
Ignored for root user
On Windows, one test still fails.
@kenjis Maybe you need to delete "C:...\ci-app-for-ci-phpunit-test\application\tests_tests/tmp" dir before running test.
PS: What about running test with your original master branch on windows?
@tianhe1986
PS: What about running test with your original master branch on windows?
2 failures. See https://github.com/kenjis/ci-app-for-ci-phpunit-test/pull/7#issuecomment-234712255
@kenjis I see.
I think you run your master branch test and after then my PR without delete the "tmp" directory and also its sub directory , right ? Then mkdir function would return false since file already exists.
I should also modify the "tearDownAfterClass" code to clear directory recursively, but I'm a little lazy.
So could you run my PR code agian after delete the "tmp" directory manually? It may be the source of this problem.
@tianhe1986 You're right. I merged this PR.
I get the following messages while running unittest with root user.
I tried to use "is_really_writable" at the beginning for checking(see here) but it also failed.
I got the same result even with the following code, "is_writable" returns false with root user when running with phpunit.
However, it works well with the following code put in a single file being executed with php command-line.
The output is
with non-root user , and is
with root user.
Could you help to test it in case of my wrong configuration ?
Signed-off-by: tianhe1986 w1s2j3229@163.com