-
Notifications
You must be signed in to change notification settings - Fork 82
Added support for file URL attachments #100
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
Added support for file URL attachments #100
Conversation
be8b82f to
9d3eb73
Compare
9d3eb73 to
8fa4e99
Compare
Seems like a couple things have changed since we last ran the tests 2 years ago. Updated phpunit version number because some class names changed, phpunit.xml needed to be changed, reference v1.0.3 of xAPI, and fixed some Exception language that seems to have changed.
8fa4e99 to
2d4ec21
Compare
brianjmiller
left a comment
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.
Couple quick comments.
| convertWarningsToExceptions="true" | ||
| processIsolation="false" | ||
| stopOnFailure="false" | ||
| syntaxCheck="false" |
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.
What's the reason to disable the syntaxCheck?
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.
syntaxCheck isn't in the latest version of phpunit. I guess I removed this before I specified the version of phpunit we're using. I'll revert it.
tests/RemoteLRSTest.php
Outdated
| public function testRetrieveStatementWithFileUrlAttachments() { | ||
| $lrs = new RemoteLRS(self::$endpoint, self::$version, self::$username, self::$password); | ||
| $attachments = new Attachment(); | ||
| $pdfUrl = 'http://www.adlnet.gov/wp-content/uploads/2013/10/xAPI_v1.0.1-2013-10-01.pdf'; |
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.
I realize this won't get fetched, but we probably don't want to point to an external resource, nor include another file in the repo for this purpose. See the tests/files/image.jpg which can be linked at https://github.com/RusticiSoftware/TinCanPHP/raw/master/tests/files/image.jpg (could also point at one of the raw github services).
Right now, we will choke on any attachments that are just a file URL and not actual contents of the file being referenced. Changed the look-up for the hash to be a little more careful instead of assuming that an attachment with that hash will exist.
Getting this to run required a bit of catch up, since no one has touched this repo is a couple years. The first commit is just some small stuff like specifying a specific version of phpunit (one which is no longer supported, but that's a different PR), updating the versions of xAPI we support, updated phpunit.xml, etc.