-
Notifications
You must be signed in to change notification settings - Fork 198
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
Migrate to PHPUnit 6.0 (related to PHP runtime) #117
Comments
Would having |
I don't have info about what version of PHPUnit they have installed for the |
I've updated However, a few tests seems to be broken with "Risky test" diagnosis. Can you take a look? |
OK |
Risky tests are tests without assertions, i.e. without any class DocstringsTest extends TestCase {
public function testDocstrings() {
$r = Docstrings::fromFile(self::SRC_DIR_PATH . "/fixed_struct.bin");
// This test should not do any assertions, so use $this->assertTrue(true) to mark it as not Risky (R).
$this->assertTrue(true);
}
} We could move the
There are 2 useful methods also:
E.g. of usage: class DebugEnumNameTest extends TestCase {
public function testDebugEnumName() {
$r = DebugEnumName::fromFile(self::SRC_DIR_PATH . "/fixed_struct.bin");
# this test is meaningful only for languages that have --debug and do
# not save enum type info
$this->markTestSkipped();
}
} |
Thanks for the explanation! Could you add these fixes then? I'll analyze and add support for skipped tests as "green" ones. |
Ok, the pull request has been created. |
Is that ok for you if we close this issue? |
Just a little more, I'd like to ensure that "risky" and "skipped" are now rendered properly ;) |
Ok, better late than never ;) Sorry for the delays. Got it working, result can be seen on CI. PHP should be back to 100% now. |
Great, thank you! |
Now PHPUnit 6.x is stable and previous versions (< 6.0) are outdated. The main change is changing the naming of classes and introducing namespaces: the old class names in format
PHPUnit_Framework_TestCase
(no namespaces) was replaced with\PHPUnit\Framework\TestCase
(i.e. class TestCase under the PHPUnit\Framework namespace).Here are steps to migrate to PHPUnit 6.0:
phpunit
executable and not downloaded one, here is an excerpt from CI logs:To fix it we could use absolute paths or remove the existing already installed phpunit, something like that:
@GreyCat I will update the kaitai_struct_php_runtime to use PHPUnit 6.x.
The text was updated successfully, but these errors were encountered: