Ejegg has uploaded a new change for review. https://gerrit.wikimedia.org/r/313224
Change subject: DO NOT MERGE investigate SQLite persistence ...................................................................... DO NOT MERGE investigate SQLite persistence Sure seems like we get totally different DBs for each PDO object Change-Id: I9705d066a377a59918a4415816b1839f767b708a --- M PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php 1 file changed, 30 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig refs/changes/24/313224/1 diff --git a/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php b/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php index d74d7d1..0a762f1 100644 --- a/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php +++ b/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php @@ -51,6 +51,36 @@ $listener->execute( $request, $response ); } + public function testSqlitePersistence() { + echo( "\nCreating and populating table foo in mem db 1\n" ); + $p1 = new \PDO( 'sqlite::memory:'); + $p1->exec( 'CREATE TABLE foo( bar int )'); + $p1->exec( 'insert into foo(bar) values (5)'); + $s1 = $p1->prepare('SELECT * from foo'); + $s1->execute(); + echo( "\nSelecting from table foo in mem db 1\n" ); + foreach( $s1->fetchAll() as $record ) { + echo( 'db1 foo record: ' . print_r( $record, true ) ); + } + + echo( "\nSelecting from table foo in mem db 2\n" ); + $p2 = new \PDO( 'sqlite::memory:'); + $s2 = $p2->prepare('SELECT * from foo'); + $s2->execute(); + + foreach( $s2->fetchAll() as $record ) { + echo( 'db2 foo record: ' . print_r( $record, true ) ); + } + + echo( "\nSelecting from table quux in mem db 2\n" ); + $s3 = $p2->prepare('SELECT * from quux'); + $s3->execute(); + + foreach( $s3->fetchAll() as $record ) { + echo( 'db2 quux record: ' . print_r( $record, true ) ); + } + } + public function testCapture() { foreach ( self::$messages as $type => $msg ) { -- To view, visit https://gerrit.wikimedia.org/r/313224 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9705d066a377a59918a4415816b1839f767b708a Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/SmashPig Gerrit-Branch: master Gerrit-Owner: Ejegg <eeggles...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits