/** * Determines the collection name to use. For graphs, it converts "vertex" and "edge" into the appropriate collection names on the server. * @param string $type The collection name. * @throws FinderException * @return string */ private function getCollectionName($type) { if ($this->_toolbox->isGraph()) { if (!$this->_toolbox->getPodManager()->validateType($type)) { throw new FinderException("When finding documents in graphs, only the types 'vertex' and 'edge' are allowed."); } //Is a vertex if (strtolower($type) == "vertex") { return $this->_toolbox->getVertexCollectionName(); //Is an edge } else { return $this->_toolbox->getEdgeCollectionName(); } } else { return $type; } }
/** * @covers Paradox\Toolbox::isGraph */ public function testIsGraphOnToolboxNotManagingAGraph() { $this->assertFalse($this->toolbox->isGraph(), "The toolbox does not manage a graph, so isGraph() should return false"); }