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

Add 1.0.2 and 1.0.3 to the list of supported versions #81

Closed
garemoko opened this issue Jan 6, 2017 · 10 comments
Closed

Add 1.0.2 and 1.0.3 to the list of supported versions #81

garemoko opened this issue Jan 6, 2017 · 10 comments

Comments

@garemoko
Copy link
Contributor

garemoko commented Jan 6, 2017

Seems like we just need to change here:

public function testStaticFactoryReturnsInstance() {
$this->assertInstanceOf("TinCan\Version", Version::v101(), "factory returns instance");
}
public function testToString() {
$this->assertInternalType("string", (string) Version::v101(), "object converts to string");
}
public function testHasValueReturnsBool() {
$this->assertTrue(Version::v101()->hasValue(Version::V101), "object has correct value");
}

and:

const V101 = "1.0.1";
const V100 = "1.0.0";
const V095 = "0.95";
/**#@- */
/** @var array string => bool */
private static $supported = [
self::V101 => true,
self::V100 => true,
self::V095 => false
];

Should we modify this so that any 1.0.x version is supported?

@GrantBailey
Copy link

Andrew that sounds like a good idea.
Setting the version as 1.0.3 using the setVersion property of the Statement object seems to work for me (I use the SCORM Cloud LRS). However this may be unrelated to your question.

@WillSkates
Copy link

@garemoko Maybe introducing constraints on the version number would also be good. Is there also a need to resolve things like "v1.0.0", "1.0.0", "1" and "1.0" to the same version number?

@brianjmiller
Copy link
Member

brianjmiller commented Jan 26, 2017

@WillSkates those aren't accepted version strings. I'm potentially okay to loosen any constraint on what we are reading back from an LRS (though they still have to be validly formatted), but the library can't get ahead of itself with what it sends.

@garemoko
Copy link
Contributor Author

I read that as the library accepting variant strings and translating them. I don't think that's necessary though as it's not hard for people to get the version right.

@WillSkates
Copy link

@garemoko You got it. I'd agree completely as long as there is a small list to remember. I truthfully don't know how many versions there are.

@garemoko
Copy link
Contributor Author

0.9, 0.95, 1.0.0, 1.0.1, 1.0.2, 1.0.3

@WillSkates
Copy link

Hmm. It might be worth translating ^1.0 and ^0.9 in that case.

@brianjmiller
Copy link
Member

Yeah, I'm not in favor of helping translate simple strings like this. xAPI is already a highly technical spec, and this library while a big help for parts of it, just shouldn't be used by people who don't understand simple versioning basics. On top of that there is a method they can call to get the actual list of all possible supported versions from the library. And finally, it defaults to latest so unless they are bit twiddling something specifically around versioning (in which case they need to be exceedingly precise anyways) then they don't ever actually have to interact with an actual version string.

@WillSkates
Copy link

WillSkates commented Jan 27, 2017

@brianjmiller That makes perfect sense.

On another note do you have any idea why #82 and #83 are failing? It doesn't seem to have anything to do with the code changes.

@reedmclean
Copy link
Contributor

4495a44 has taken care of this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants