/** * @return array */ public function getData() { $folderDesignDocument = new \Doctrine\CouchDB\View\FolderDesignDocument($this->options['path']); return $folderDesignDocument->getData(); }
public function testGetViewsBasedOnFileStructure() { $designDoc = new \Doctrine\CouchDB\View\FolderDesignDocument(__DIR__ . "/../../../Models/CMS/_files/"); $this->assertEquals(array("rewrites" => array(array("from" => "/from/url", "to" => "/to/url", "query" => array("descending" => "true", "include_docs" => "true")), array("from" => "/from/url2", "to" => "/to/url2", "query" => array("descending" => "true", "include_docs" => "true"))), "views" => array("username" => array("map" => "function(doc) {\n if (doc.type == 'Doctrine.Tests.Models.CMS.CmsUser') {\n emit(doc.username, doc._id);\n }\n}"))), $designDoc->getData()); }
public function testGetViewsBasedOnFileStructure() { $designDoc = new \Doctrine\CouchDB\View\FolderDesignDocument(__DIR__ . "/../../../Models/CMS/_files/"); $this->assertEquals(array("views" => array("username" => array("map" => "function(doc) {\n if (doc.type == 'Doctrine.Tests.Models.CMS.CmsUser') {\n emit(doc.username, doc._id);\n }\n}"))), $designDoc->getData()); }