jenkins-bot has submitted this change and it was merged.
Change subject: Fix DamagedDb::storeMessage return value
......................................................................
Fix DamagedDb::storeMessage return value
Lost in the prepareAndExecute refactor, useful for failmail links.
Change-Id: I74a795e8717d73387de36182e2081acee9188bbe
---
M Core/DataStores/DamagedDatabase.php
M Tests/DamagedDatabaseTest.php
2 files changed, 4 insertions(+), 2 deletions(-)
Approvals:
Cdentinger: Looks good to me, approved
jenkins-bot: Verified
diff --git a/Core/DataStores/DamagedDatabase.php
b/Core/DataStores/DamagedDatabase.php
index 8f6e60a..19d6b3a 100644
--- a/Core/DataStores/DamagedDatabase.php
+++ b/Core/DataStores/DamagedDatabase.php
@@ -66,6 +66,8 @@
VALUES ( $paramList );";
$this->prepareAndExecute( $insert, $dbRecord );
+
+ return $this->getDatabase()->lastInsertId();
}
/**
diff --git a/Tests/DamagedDatabaseTest.php b/Tests/DamagedDatabaseTest.php
index db03227..c373e9e 100644
--- a/Tests/DamagedDatabaseTest.php
+++ b/Tests/DamagedDatabaseTest.php
@@ -52,7 +52,7 @@
$err = 'ERROR MESSAGE';
$trace = "Foo.php line 25\nBar.php line 99";
- $this->db->storeMessage( $message, $queue, $err, $trace );
+ $damagedId = $this->db->storeMessage( $message, $queue, $err,
$trace );
// Confirm work without using the API.
$pdo = $this->db->getDatabase();
@@ -64,7 +64,7 @@
$this->assertEquals( 1, count( $rows ),
'One row stored and retrieved.' );
$expected = array(
- 'id' => '1',
+ 'id' => $damagedId,
# NOTE: This is a db-specific string, sqlite3 in this
case, and
# you'll have different formatting if using any other
database.
'original_date' => '20160720001408',
--
To view, visit https://gerrit.wikimedia.org/r/317273
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I74a795e8717d73387de36182e2081acee9188bbe
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: master
Gerrit-Owner: Ejegg <[email protected]>
Gerrit-Reviewer: Awight <[email protected]>
Gerrit-Reviewer: Cdentinger <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits