/** * @expectedException \RuntimeException * @expectedExceptionMessage \NYPL\SchemaBuilder\Outputter\MicrodataOutputter::EXCEPTION_SUB_PROPERTY_OUTPUTTED_BEFORE_OBJECT */ public function testParentPropertyThrowsExceptionIfNotOutputter() { $itemProperty = 'offers'; $parentItemProperty = 'offeredBy'; $offer = new Schema('Offer'); $offer->addProperty($parentItemProperty, 'NYPL'); $this->schema->addProperty($itemProperty, $offer); $this->schema->getMicrodata(); $this->schema->getProperty('offers')->getMicrodata('offeredBy'); }
/** * @expectedException \OutOfBoundsException * @expectedExceptionMessage \NYPL\SchemaBuilder\Schema::EXCEPTION_PROPERTY_DOES_NOT_EXIST */ public function testGetPropertyWithoutExistingThrowsException() { $schema = new Schema('Book'); $schema->getProperty('invalid'); }