Skip to content
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

Feature TR-4391 ensure PHP 8.1 support by the legacy release #321

Merged
merged 11 commits into from
Jul 18, 2022
Prev Previous commit
Next Next commit
tests: downgrade php unit
  • Loading branch information
kilatib committed Jul 18, 2022
commit a4278cd7390ac5f4ff6a70fa1318101d212634e6
11 changes: 9 additions & 2 deletions test/qtismtest/common/dom/SerializableDomDocumentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use qtism\common\dom\SerializableDomDocument;
use qtismtest\QtiSmTestCase;
use Error;

/**
* Class VersionTest
Expand Down Expand Up @@ -33,7 +34,10 @@ public function testAccessingInexistentProperty()
$dom = $this->getSerializableDomDocument();
$property = 'test';

$this->expectError();
$this->expectException(Error::class);
$this->expectExceptionMessage(
sprintf('Undefined property: %s::%s', SerializableDomDocument::class, $property)
);

$dom->$property;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am getting this error locally:

Time: 01:53.357, Memory: 84.00 MB

There was 1 error:

1) qtismtest\common\dom\SerializableDomDocumentTest::testAccessingInexistentProperty
Undefined property: qtism\common\dom\SerializableDomDocument::test

/Users/gabriel.soares/repos/qti-sdk/qtism/common/dom/SerializableDomDocument.php:164
/Users/gabriel.soares/repos/qti-sdk/test/qtismtest/common/dom/SerializableDomDocumentTest.php:42
phpvfscomposer:///Users/gabriel.soares/repos/qti-sdk/vendor/phpunit/phpunit/phpunit:97

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, problem with 7.1 and 7.2 with correctly catch this exception I research a solution to downgrade the $this->expectWarning(); method

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check now

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test is passing now, thanks

}
Expand Down Expand Up @@ -69,7 +73,10 @@ public function testCallingNotExistedVirtualMethods()
$dom = $this->getSerializableDomDocument();
$method = 'saveXML2';

$this->expectError();
$this->expectException(Error::class);
$this->expectExceptionMessage(
sprintf('Call to undefined method %s::%s()', SerializableDomDocument::class, $method)
);

$dom->$method();
}
Expand Down