You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Automate creating a test file using the generate:{suite/test} command, synched with IDE when a file is added/modified.
In this scenario, sometimes calculated relative path for the generating test file contains a dot. In that case, an invalid syntax is inserted in the resulting generated test file.
Passing a relative path is useful to keep a synchronized structure with the source directory. For example, passing "foo/bar" creates a test file unit/foo/barTest.php. This is great.
$ php codecept.phar generate:test unit "foo/bar"
However, when it contains a dot, like
$ php codecept.phar generate:test unit "./foo"
it creates a file fooTest.php with an invalid namespace syntax. The dot something passed by IDE.
What do you get instead?
A namespace with a dot gets inserted at the beginning of the generated file, which is invalid syntax and causes a fatal error. So it must be manually removed.
What are you trying to achieve?
Automate creating a test file using the
generate:{suite/test}
command, synched with IDE when a file is added/modified.In this scenario, sometimes calculated relative path for the generating test file contains a dot. In that case, an invalid syntax is inserted in the resulting generated test file.
Passing a relative path is useful to keep a synchronized structure with the source directory. For example, passing
"foo/bar"
creates a test fileunit/foo/barTest.php
. This is great.$ php codecept.phar generate:test unit "foo/bar"
However, when it contains a dot, like
$ php codecept.phar generate:test unit "./foo"
it creates a file
fooTest.php
with an invalid namespace syntax. The dot something passed by IDE.What do you get instead?
A namespace with a dot gets inserted at the beginning of the generated file, which is invalid syntax and causes a fatal error. So it must be manually removed.
Details
The text was updated successfully, but these errors were encountered: