New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a test to check Infection works with PSR-0 compliant autoloader #579
Conversation
|
||
namespace PSR_0_Autoloader; | ||
|
||
class SourceClass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's just as same as the current PSR-4. I think if test best to test a really old-style Namespace_Class_Name
style project.
For example, I could not run Infection on pear/OLE. It gives:
Processing source code files: 4/7
In CodeCoverageClassIgnoreVisitor.php line 63:
Class OLE_Test does not exist
Even though composer.json has all relevant definitions:
"autoload-dev": {
"psr-0": {
"OLE": "tests/"
}
},
I even made a simple test to verify that indeed composer picks up OLE_Test
:
class OLE_AutoloadTest extends PHPUnit_Framework_TestCase
{
public function testOtherTestExists()
{
$this->assertTrue(class_exists(OLE_Test::class));
}
}
On subsequent runs, for some very interesting reason:
In JsonValidationException.php line 51:
"OLE/infection.json.dist" does not match the expected JSON schema:
- source.excludes : Object value found, but an array is required
The last error possibly related to these configuration steps:
Any directories to exclude from within your source directories?: tests
Any directories to exclude from within your source directories?: coverage
Any directories to exclude from within your source directories?: build
Any directories to exclude from within your source directories?: vendor
Any directories to exclude from within your source directories?:
infection.json has this:
"excludes": {
"0": "vendor",
"1": "tests",
"3": "coverage",
"4": "build"
}
Filed #580
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, that's not an unknown issue with "Class OLE_Test does not exist", just #576
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, that's not an unknown issue with "Class OLE_Test does not exist", just #576
ok, I'm merging this one since it's not related to any issue, this is only a new test
Related to #564
hmm.. E2E tests, wrapped by PHPUnit fails because it alwayse requires psr4 autoloader. Will have to fix it.