jenkins-bot has submitted this change and it was merged.
Change subject: Hygiene: Remove unused mock class
......................................................................
Hygiene: Remove unused mock class
Change-Id: I24acf4e9382a473d223627bd5816694a91145450
---
D tests/MockStorage.php
1 file changed, 0 insertions(+), 66 deletions(-)
Approvals:
Bsitu: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/MockStorage.php b/tests/MockStorage.php
deleted file mode 100644
index 8e5386c..0000000
--- a/tests/MockStorage.php
+++ /dev/null
@@ -1,66 +0,0 @@
-<?php
-
-namespace Flow\Data;
-
-/**
- * Bare minimum ObjectStorage implementation does
- * nothing. Query results must be passed in the constructor.
- *
- * Usage:
- *
- * $om = new MockObjectManager( 'rev_id', array(
- * array(
- * // query
- * array( 'rev_descendant_id' => 5 ),
- * // options
- * array( 'sort' => 'rev_id', 'order' => 'DESC', 'limit'
=> 1 ),
- * // results
- * array(
- * array( 'rev_id' => 22, 'rev_descendant_id' =>
5, ... ),
- * ),
- * ),
- * ) );
- */
-class MockObjectManager implements ObjectManager {
- /**
- * @var string
- */
- protected $primaryKey;
-
- /**
- * @var array
- */
- protected $results;
-
- public function __construct( $primaryKey, array $results ) {
- $this->primaryKey = $primaryKey;
- $this->results = $results;
- }
-
- public function find( $attributes, array $options = array() ) {
- // Slow for now, could be faster if it matters
- foreach ( $this->results as $meta ) {
- if ( $attributes === $meta[0] && $options === $meta[1]
) {
- return $meta[2];
- }
- }
- return null;
- }
-
- public function findMulti( array $queries, array $options = array() ) {
- $res = array();
- foreach ( $queries as $query ) {
- $res[] = $this->find( $query, $options );
- }
- return $res;
- }
-
- public function getPrimaryKeyColumns() {
- return $this->primaryKey;
- }
-
- public function clear() {}
- public function insert( array $row ) {}
- public function update( array $old, $new ) {}
- public function remove( array $row ) {}
-}
--
To view, visit https://gerrit.wikimedia.org/r/155846
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I24acf4e9382a473d223627bd5816694a91145450
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: EBernhardson <[email protected]>
Gerrit-Reviewer: Bsitu <[email protected]>
Gerrit-Reviewer: SG <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits