1 | <?php |
||
18 | class ApiTest extends \PHPUnit_Framework_TestCase { |
||
19 | |||
20 | public function testApiStore() { |
||
21 | date_default_timezone_set( 'UTC' ); |
||
22 | $store = $this->getEntityStoreFromConfiguration(); |
||
23 | |||
24 | $this->assertEquals( |
||
25 | new ItemId( 'Q1' ), |
||
26 | $store->getItemLookup()->getItemForId( new ItemId( 'Q1' ) )->getId() |
||
27 | ); |
||
28 | |||
29 | $results = $store->getEntityDocumentLookup()->getEntityDocumentsForIds( |
||
30 | [ new ItemId( 'Q1' ), new PropertyId( 'P18' ) ] |
||
31 | ); |
||
32 | $this->assertEquals( 2, count( $results ) ); |
||
33 | |||
34 | $this->assertEquals( |
||
35 | [ new ItemId( 'Q260' ) ], |
||
36 | $store->getItemIdForTermLookup()->getItemIdsForTerm( new Term( 'fr', 'Jean-François Champollion' ) ) |
||
37 | ); |
||
38 | |||
39 | $this->assertEquals( |
||
40 | [ new PropertyId( 'P16' ) ], |
||
41 | $store->getPropertyIdForTermLookup()->getPropertyIdsForTerm( new Term( 'en', 'highway system' ) ) |
||
42 | ); |
||
43 | |||
44 | $this->assertEquals( |
||
45 | [ new ItemId( 'Q1' ) ], |
||
46 | $store->getItemIdForQueryLookup()->getItemIdsForQuery( new SomeProperty( |
||
47 | new EntityIdValue( new PropertyId( 'P18' ) ), |
||
48 | new ValueDescription( new StringValue( 'Hubble ultra deep field.jpg' ) ) |
||
49 | ) ) |
||
50 | ); |
||
51 | } |
||
52 | |||
53 | private function getEntityStoreFromConfiguration() { |
||
57 | } |
||
58 |