Mwjames has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/60095


Change subject: SMW\ParserDataTest add additional assertion
......................................................................

SMW\ParserDataTest add additional assertion

Change-Id: I4365c3c3701cb5fb7434c130b10c949f07efaeb0
---
M tests/phpunit/includes/ParserDataTest.php
1 file changed, 18 insertions(+), 10 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticMediaWiki 
refs/changes/95/60095/1

diff --git a/tests/phpunit/includes/ParserDataTest.php 
b/tests/phpunit/includes/ParserDataTest.php
index 414e9fa..03c407a 100644
--- a/tests/phpunit/includes/ParserDataTest.php
+++ b/tests/phpunit/includes/ParserDataTest.php
@@ -39,6 +39,13 @@
  * @licence GNU GPL v2+
  * @author mwjames
  */
+
+/**
+ * Tests for the SMW\ParserData class
+ *
+ * @ingroup SMW
+ * @ingroup Test
+ */
 class ParserDataTest extends \MediaWikiTestCase {
 
        /**
@@ -90,26 +97,26 @@
         * @return array
         */
        public function getPropertyValueDataProvider() {
-
-               // property, value, errorCount
+               // property, value, errorCount, propertyCount
                return array(
-                       array( 'Foo'  , 'Bar', 0 ),
-                       array( '-Foo' , 'Bar', 1 ),
-                       array( '_Foo' , 'Bar', 1 ),
+                       array( 'Foo'  , 'Bar', 0, 1 ),
+                       array( '-Foo' , 'Bar', 1, 0 ),
+                       array( '_Foo' , 'Bar', 1, 0 ),
                );
        }
 
        /**
-        * @dataProvider getPropertyValueDataProvider
+        * Test SMW\ParserData::addPropertyValue
         *
-        * @see SMW\ParserData::addPropertyValue
         * @since 1.9
         *
+        * @dataProvider getPropertyValueDataProvider
         * @param $propertyName
         * @param $value
-        * @param $error
+        * @param $errorCount
+        * @param $propertyCount
         */
-       public function testAddPropertyValue( $propertyName, $value, $error ) {
+       public function testAddPropertyValue( $propertyName, $value, 
$errorCount, $propertyCount ) {
                $instance = $this->getInstance( 'Foo', $this->getParserOutput() 
);
 
                // Values
@@ -122,7 +129,8 @@
 
                // Check the returned instance
                $this->assertInstanceOf( 'SMWSemanticData', 
$instance->getData() );
-               $this->assertCount( $error, $instance->getErrors() );
+               $this->assertCount( $errorCount, $instance->getErrors() );
+               $this->assertCount( $propertyCount, 
$instance->getData()->getProperties() );
 
                // Check added properties
                foreach ( $instance->getData()->getProperties() as $key => 
$diproperty ){

-- 
To view, visit https://gerrit.wikimedia.org/r/60095
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4365c3c3701cb5fb7434c130b10c949f07efaeb0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticMediaWiki
Gerrit-Branch: master
Gerrit-Owner: Mwjames <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to