function test_order_uris_by_property() { $ex = "http://example.com/"; $turtle = <<<_TTL_ @base <{$ex}> . <a> <p> 2 . <b> <p> 3 . <c> <p> 1 . _TTL_; $graph = new SimpleGraph(); $graph->from_turtle($turtle); $uris = array($ex . 'a', $ex . 'b', $ex . 'c'); $expected = array($ex . 'c', $ex . 'a', $ex . 'b'); $actual = $graph->order_uris_by_property($uris, $ex . 'p'); $this->assertEquals($expected, $actual, "order_uris_by_property should order the uris in ascending order of the value of the property"); $expected_reverse = array($ex . 'b', $ex . 'a', $ex . 'c'); $actual = $graph->order_uris_by_property($uris, $ex . 'p', 1); $this->assertEquals($expected_reverse, $actual, "order_uris_by_property should order the uris in ascending order of the value of the property"); }