From eabc12db120977c342b85834fd33fec542eea86f Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Wed, 11 Jul 2012 22:06:40 -0400 Subject: [PATCH] Refactor map/reduce options test in QueryTest --- .../MongoDB/Tests/Query/QueryTest.php | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/tests/Doctrine/MongoDB/Tests/Query/QueryTest.php b/tests/Doctrine/MongoDB/Tests/Query/QueryTest.php index ec9cb5ee..a86137cc 100644 --- a/tests/Doctrine/MongoDB/Tests/Query/QueryTest.php +++ b/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();