From 8344c91e0d5daaf2e0617f50264cb605cafe8297 Mon Sep 17 00:00:00 2001 From: = Date: Thu, 25 Feb 2016 13:41:09 +0100 Subject: [PATCH] Add use Exception in XmlCompactDocument. --- composer.json | 2 +- qtism/data/storage/xml/XmlCompactDocument.php | 2 +- test/qtism/common/datatypes/DurationTest.php | 8 ++------ test/qtism/runtime/pci/json/JsonMarshallerTest.php | 4 ++-- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/composer.json b/composer.json index 1b5ca4948..d78be1de3 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "qtism/qtism", "description": "OAT QTI Software Module Library", "type": "library", - "version": "0.9.19", + "version": "0.9.20", "authors": [ { "name": "Open Assessment Technologies S.A.", diff --git a/qtism/data/storage/xml/XmlCompactDocument.php b/qtism/data/storage/xml/XmlCompactDocument.php index c571cd106..21acf2e58 100644 --- a/qtism/data/storage/xml/XmlCompactDocument.php +++ b/qtism/data/storage/xml/XmlCompactDocument.php @@ -25,7 +25,6 @@ namespace qtism\data\storage\xml; use qtism\data\content\RubricBlockRef; - use qtism\data\QtiComponentIterator; use qtism\data\QtiComponent; use qtism\data\TestPart; @@ -41,6 +40,7 @@ use qtism\data\storage\xml\marshalling\CompactMarshallerFactory; use \DOMElement; use \SplObjectStorage; +use \Exception; class XmlCompactDocument extends XmlDocument { diff --git a/test/qtism/common/datatypes/DurationTest.php b/test/qtism/common/datatypes/DurationTest.php index b8efd1296..6bca475a4 100644 --- a/test/qtism/common/datatypes/DurationTest.php +++ b/test/qtism/common/datatypes/DurationTest.php @@ -22,10 +22,10 @@ public function testInvalidDurationCreation($intervalSpec) { } public function testPositiveDuration() { - $duration = new Duration('P3Y4DT6H8M'); // 2 years, 4 days, 6 hours, 8 minutes, 0 seconds, 0 microseconds. + $duration = new Duration('P3Y0DT6H8M'); // 2 years, 0 days, 6 hours, 8 minutes, 0 seconds, 0 microseconds. $this->assertEquals(3, $duration->getYears()); $this->assertEquals(0, $duration->getMonths()); - $this->assertEquals(4, $duration->getDays()); + $this->assertEquals(0, $duration->getDays()); $this->assertEquals(6, $duration->getHours()); $this->assertEquals(8, $duration->getMinutes()); $this->assertEquals(0, $duration->getSeconds()); @@ -43,10 +43,6 @@ public function testEquality() { $this->assertFalse($d3->equals($d1)); $this->assertTrue($d3->equals($d3)); } - - public function testNegativeDuration() { - $duration = new Duration('P2Y4DT6H8M'); // - 2 years, 4 days, 6 hours, 8 minutes. - } public function testConstruct() { diff --git a/test/qtism/runtime/pci/json/JsonMarshallerTest.php b/test/qtism/runtime/pci/json/JsonMarshallerTest.php index 207179888..9252ed9ee 100644 --- a/test/qtism/runtime/pci/json/JsonMarshallerTest.php +++ b/test/qtism/runtime/pci/json/JsonMarshallerTest.php @@ -99,7 +99,7 @@ public function testMarshallState(State $state, $expectedJson) { * @param mixed $input */ public function testMarshallInvalidInput($input) { - $this->setExpectedException('qtism\\runtime\\pci\\json\\MarshallingException', MarshallingException::NOT_SUPPORTED); + $this->setExpectedException('qtism\\runtime\\pci\\json\\MarshallingException', '', MarshallingException::NOT_SUPPORTED); $marshaller = new Marshaller(); $marshaller->marshall($input); } @@ -310,4 +310,4 @@ public function marshallInvalidInputProvider() { array(new \stdClass()) ); } -} \ No newline at end of file +}