Skip to content
Browse files

Refactor map/reduce options test in QueryTest

  • Loading branch information...
1 parent bf542f0 commit eabc12db120977c342b85834fd33fec542eea86f @jmikola jmikola committed Jul 11, 2012
Showing with 3 additions and 16 deletions.
  1. +3 −16 tests/Doctrine/MongoDB/Tests/Query/QueryTest.php
View
19 tests/Doctrine/MongoDB/Tests/Query/QueryTest.php
@@ -6,25 +6,18 @@
class QueryTest extends \PHPUnit_Framework_TestCase
{
- const MAP_REDUCE_OPTION_KEY = 'limit';
- const MAP_REDUCE_OPTION_VALUE = 10;
-
public function testMapReduceOptionsArePassed()
{
$collection = $this->getMockCollection();
- $mapReduceOptions = array(
- self::MAP_REDUCE_OPTION_KEY => self::MAP_REDUCE_OPTION_VALUE
- );
-
$queryArray = array(
'type' => Query::TYPE_MAP_REDUCE,
'mapReduce' => array(
'map' => '',
'reduce' => '',
- 'options' => $mapReduceOptions
+ 'options' => array('limit' => 10),
),
- 'query' => array()
+ 'query' => array()
);
$query = new Query(
@@ -41,13 +34,7 @@ public function testMapReduceOptionsArePassed()
$this->anything(),
$this->anything(),
$this->anything(),
- $this->logicalAnd(
- $this->arrayHasKey(self::MAP_REDUCE_OPTION_KEY),
- new ArrayHasValueUnderKey(
- self::MAP_REDUCE_OPTION_KEY,
- self::MAP_REDUCE_OPTION_VALUE
- )
- )
+ new ArrayHasValueUnderKey('limit', 10)
);
$query->execute();

0 comments on commit eabc12d

Please sign in to comment.
Something went wrong with that request. Please try again.