/** * Get the type information by (full) RDF name * * @param string $rdf * * @return TypeInterface */ public function getTypeByRdf($rdf) { $map = $this->driver->getAllNames(); if (!isset($map[$rdf])) { throw new TypeNotFoundException("No type for {$rdf}"); } return $this->getTypeByName($map[$rdf]); }
/** * Gets the names of all revs known to this type. * * @return array The names of all revs known to this type. */ public function testGetRevOptions() { $mapper = $this->getMock('Midgard\\CreatePHP\\RdfMapperInterface'); $typeFactory = $this->getMockBuilder('Midgard\\CreatePHP\\Metadata\\RdfTypeFactory')->disableOriginalConstructor()->getMock(); $type = $this->driver->loadType('Test\\Midgard\\CreatePHP\\Model', $mapper, $typeFactory); $revs = array('dcterms:partOf' => 'dcterms:partOf'); $this->assertEquals($revs, $type->getRevOptions()); }