There two problems with the CSV source tests:
- They are not discovered by PHPUnit.
- Once you get them running there is a failing test
The first problem is explained at https://www.drupal.org/node/2499239. Currently PHPUnit is only able to find tests that are located at the top level of the /modules folder. Submodules are not discoverable and that probably won't change. Even if you navigate to the submodule on the command line the tests don't appear. The solution is to add a phpunit.xml.dist and corresponding bootstrap.php file. With those added you can navigate to the module on the command line and you'll see and be able to run the tests.
The second problem is that once you get it working there are failing tests. The failures are because you can't test a protected function (getIterator). The fix for that is to add a reflection class to make the protected function testable.
Patch coming that fixes both problems.
Comment | File | Size | Author |
---|---|---|---|
#3 | 2609048.patch | 5.03 KB | KarenS |
#2 | 2609048.patch | 0 bytes | KarenS |
Comments
Comment #2
KarenS CreditAttribution: KarenS at Lullabot commentedHere's the patch.
Comment #3
KarenS CreditAttribution: KarenS at Lullabot commentedOops, trying again.
Comment #4
heddnRe-assigning to new project name-space.
Comment #5
drummComment #7
heddnI made some minor tweaks on commit. I think core changed the visibility for getIterator() while tests were in the broken state. I could be wrong, but calling initializeIterator() seems like a more simple solution than using reflection. For now, marking as fixed, but we can always re-add the reflection if that is the better direction to use.