55 $sites = $store->getSites();
57 $this->assertInstanceOf( SiteList::class, $sites );
62 foreach ( $sites
as $site ) {
63 $this->assertInstanceOf( Site::class, $site );
66 foreach ( $expectedSites
as $site ) {
67 if ( $site->getGlobalId() !==
null ) {
68 $this->assertTrue( $sites->hasSite( $site->getGlobalId() ) );
82 $site->setGlobalId(
'ertrywuutr' );
83 $site->setLanguageCode(
'en' );
87 $site->setGlobalId(
'sdfhxujgkfpth' );
88 $site->setLanguageCode(
'nl' );
91 $this->assertTrue( $store->saveSites( $sites ) );
93 $site = $store->getSite(
'ertrywuutr' );
94 $this->assertInstanceOf( Site::class, $site );
95 $this->assertEquals(
'en', $site->getLanguageCode() );
96 $this->assertTrue( is_int( $site->getInternalId() ) );
97 $this->assertTrue( $site->getInternalId() >= 0 );
99 $site = $store->getSite(
'sdfhxujgkfpth' );
100 $this->assertInstanceOf( Site::class, $site );
101 $this->assertEquals(
'nl', $site->getLanguageCode() );
102 $this->assertTrue( is_int( $site->getInternalId() ) );
103 $this->assertTrue( $site->getInternalId() >= 0 );
114 $this->assertGreaterThan( 0, $store1->getSites()->count() );
115 $this->assertGreaterThan( 0, $store2->getSites()->count() );
119 $this->assertTrue( $store1->clear() );
122 $this->assertNotNull( $store2->getSite(
'enwiki' ) );
128 $site = $store2->getSite(
'enwiki' );
129 $this->assertNull( $site );