@@ -445,4 +445,58 @@ public function testReplicateFunctionReplicatesDatabase()
445445 $ this ->assertInternalType ('string ' , $ replicate );
446446 });
447447 }
448+
449+ /**
450+ * @eris-repeat 5
451+ */
452+ public function testQueryViewGetsDataFromView ()
453+ {
454+ $ this ->forAll (
455+ Generator \constant ('testdb ' ),
456+ Generator \elements ('id-designdoc ' , 'rev-designdoc ' ),
457+ Generator \constant ('map ' ),
458+ Generator \associative ([
459+ 'descending ' => Generator \elements ('true ' , 'false ' ),
460+ 'include_docs ' => Generator \elements ('true ' , 'false ' ),
461+ 'group ' => Generator \elements ('true ' , 'false ' )
462+ ])
463+ )
464+ ->then (function (string $ database , string $ ddoc , string $ view , array $ opts ) {
465+ $ promise = $ this ->action ->queryView ($ database , $ ddoc , $ view , $ opts );
466+ $ query = self ::blockFn ()($ promise , $ this ->eventLoop );
467+
468+ $ this ->assertInstanceOf (\React \Promise \Promise::class, $ promise );
469+ $ this ->assertInternalType ('string ' , $ query );
470+ });
471+ }
472+
473+ /**
474+ * @eris-ratio 0.1
475+ * @eris-repeat 5
476+ */
477+ public function testKeysQueryViewGetsSpecificKeysFromView ()
478+ {
479+ $ this ->forAll (
480+ Generator \constant ('testdb ' ),
481+ Generator \elements ('id-designdoc ' , 'rev-designdoc ' ),
482+ Generator \constant ('map ' ),
483+ Generator \associative ([
484+ 'keys ' => Generator \tuple (
485+ Generator \suchThat (self ::idConst, Generator \string ())
486+ )
487+ ]),
488+ Generator \associative ([
489+ 'descending ' => Generator \elements ('true ' , 'false ' ),
490+ 'include_docs ' => Generator \elements ('true ' , 'false ' ),
491+ 'group ' => Generator \elements ('true ' , 'false ' )
492+ ])
493+ )
494+ ->then (function (string $ database , string $ ddoc , string $ view , array $ keys , array $ opts ) {
495+ $ promise = $ this ->action ->keysQueryView ($ database , $ ddoc , $ view , $ keys , $ opts );
496+ $ query = self ::blockFn ()($ promise , $ this ->eventLoop );
497+
498+ $ this ->assertInstanceOf (\React \Promise \Promise::class, $ promise );
499+ $ this ->assertInternalType ('string ' , $ query );
500+ });
501+ }
448502}
0 commit comments