turnitin / moodle-mod_turnitintooltwo

Turnitin Direct plugin (version 2) for Moodle
http://www.turnitin.com
32 stars 63 forks source link

Failing unit test mod_turnitintooltwo_view_testcase::test_output_header, after MDL-78806 #694

Open keevan opened 9 months ago

keevan commented 9 months ago

https://tracker.moodle.org/browse/MDL-78806

Appears after this change, this test is failing: mod_turnitintooltwo_view_testcase::test_output_header

Moodle 4.1.5+ (Build: 20230915)
Php: 8.1.2.1.2.14, pgsql: 14.9 (Debian 14.9-1.pgdg120+1), OS: Linux 6.2.0-1009-aws x86_64
PHPUnit 9.5.28 by Sebastian Bergmann and contributors.

...

1) mod_turnitintooltwo_view_testcase::test_output_header
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'Fake Title'
+'Fake Title | phpunit'

/var/www/site/mod/turnitintooltwo/tests/unit/classes/view/turnitintooltwo_view_test.php:56
/var/www/site/lib/phpunit/classes/advanced_testcase.php:80

The suggestion would be to check if the string contains the expected string, instead of doing an exact match.

https://github.com/turnitin/moodle-mod_turnitintooltwo/blob/1e91c649d0bc8939fa2de53701c8f3a1f9d4b748/tests/unit/classes/view/turnitintooltwo_view_test.php#L56