52 $sites = $store->getSites();
54 $this->assertInstanceOf( SiteList::class, $sites );
59 foreach ( $sites as $site ) {
60 $this->assertInstanceOf( Site::class, $site );
63 foreach ( $expectedSites as $site ) {
64 if ( $site->getGlobalId() !==
null ) {
65 $this->assertTrue( $sites->hasSite( $site->getGlobalId() ) );
79 $site->setGlobalId(
'ertrywuutr' );
80 $site->setLanguageCode(
'en' );
84 $site->setGlobalId(
'sdfhxujgkfpth' );
85 $site->setLanguageCode(
'nl' );
88 $this->assertTrue( $store->saveSites( $sites ) );
90 $site = $store->getSite(
'ertrywuutr' );
91 $this->assertInstanceOf( Site::class, $site );
92 $this->assertEquals(
'en', $site->getLanguageCode() );
93 $this->assertTrue( is_int( $site->getInternalId() ) );
94 $this->assertTrue( $site->getInternalId() >= 0 );
96 $site = $store->getSite(
'sdfhxujgkfpth' );
97 $this->assertInstanceOf( Site::class, $site );
98 $this->assertEquals(
'nl', $site->getLanguageCode() );
99 $this->assertTrue( is_int( $site->getInternalId() ) );
100 $this->assertTrue( $site->getInternalId() >= 0 );
111 $this->assertGreaterThan( 0, $store1->getSites()->count() );
112 $this->assertGreaterThan( 0, $store2->getSites()->count() );
116 $this->assertTrue( $store1->clear() );
119 $this->assertNotNull( $store2->getSite(
'enwiki' ) );
125 $site = $store2->getSite(
'enwiki' );
126 $this->assertNull( $site );