Hoo man has uploaded a new change for review.
https://gerrit.wikimedia.org/r/114906
Change subject: Fixe the duplicate entry SQL errors in unit tests
......................................................................
Fixe the duplicate entry SQL errors in unit tests
Change-Id: I37ec742b4605e80653a247853fe23930d0d6a31d
---
M repo/tests/phpunit/includes/store/sql/SqlEntityInfoBuilderTest.php
1 file changed, 9 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase
refs/changes/06/114906/1
diff --git a/repo/tests/phpunit/includes/store/sql/SqlEntityInfoBuilderTest.php
b/repo/tests/phpunit/includes/store/sql/SqlEntityInfoBuilderTest.php
index 4db598f..1057f4d 100644
--- a/repo/tests/phpunit/includes/store/sql/SqlEntityInfoBuilderTest.php
+++ b/repo/tests/phpunit/includes/store/sql/SqlEntityInfoBuilderTest.php
@@ -92,7 +92,15 @@
$dbw = wfGetDB( DB_MASTER );
foreach ( $rows as $row ) {
- $dbw->insert( $table, array_combine( $fields, $row ),
__METHOD__ );
+ $dbw->insert(
+ $table,
+ array_combine( $fields, $row ),
+ __METHOD__,
+ // Just ignore insertation errors... if similar
data already is in the DB
+ // it's probably good enough for the tests (as
this is only testing for UNIQUE
+ // fields anyway).
+ array( 'IGNORE' )
+ );
}
}
--
To view, visit https://gerrit.wikimedia.org/r/114906
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I37ec742b4605e80653a247853fe23930d0d6a31d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Hoo man <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits