/** * Tests conversion from quads. * * @param string $name The test name. * @param object $test The test definition. * @param object $options The options to configure the algorithms. * * @group fromRdf * @dataProvider fromRdfProvider */ public function testFromRdf($name, $test, $options) { $expected = json_decode(file_get_contents($this->basedir . $test->{'expect'})); $parser = new NQuads(); $quads = $parser->parse(file_get_contents($this->basedir . $test->{'input'})); $result = JsonLD::fromRdf($quads, $options); $this->assertEquals($expected, $result); }
/** * Tests the expansion API * * @expectedException \ML\JsonLD\Exception\InvalidQuadException */ public function testInvalidParse() { $nquads = new NQuads(); $nquads->parse('Invalid NQuads file'); }