/** * Get the type with this name * * @param string $name of the type to get, i.e. the full class name * * @return TypeInterface */ public function getTypeByName($name) { if (!isset($this->loadedTypes[$name])) { $this->loadedTypes[$name] = $this->driver->loadType($name, $this->mapper, $this); } // TODO: combine types from parent models... return $this->loadedTypes[$name]; }
/** * 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()); }