44 $sites = $store->getSites();
46 $this->assertInstanceOf(
'SiteList', $sites );
51 foreach ( $sites
as $site ) {
52 $this->assertInstanceOf(
'Site', $site );
55 foreach ( $expectedSites
as $site ) {
56 if ( $site->getGlobalId() !== null ) {
57 $this->assertTrue( $sites->hasSite( $site->getGlobalId() ) );
71 $site->setGlobalId(
'ertrywuutr' );
72 $site->setLanguageCode(
'en' );
76 $site->setGlobalId(
'sdfhxujgkfpth' );
77 $site->setLanguageCode(
'nl' );
80 $this->assertTrue( $store->saveSites( $sites ) );
82 $site = $store->getSite(
'ertrywuutr' );
83 $this->assertInstanceOf(
'Site', $site );
84 $this->assertEquals(
'en', $site->getLanguageCode() );
85 $this->assertTrue( is_integer( $site->getInternalId() ) );
86 $this->assertTrue( $site->getInternalId() >= 0 );
88 $site = $store->getSite(
'sdfhxujgkfpth' );
89 $this->assertInstanceOf(
'Site', $site );
90 $this->assertEquals(
'nl', $site->getLanguageCode() );
91 $this->assertTrue( is_integer( $site->getInternalId() ) );
92 $this->assertTrue( $site->getInternalId() >= 0 );
103 $this->assertGreaterThan( 0, $store1->getSites()->count() );
104 $this->assertGreaterThan( 0, $store2->getSites()->count() );
108 $this->assertTrue( $store1->clear() );
111 $this->assertNotNull( $store2->getSite(
'enwiki' ) );
117 $site = $store2->getSite(
'enwiki' );
118 $this->assertNull( $site );
126 $this->assertTrue( $store->clear() );
128 $site = $store->getSite(
'enwiki' );
129 $this->assertNull( $site );
131 $sites = $store->getSites();
132 $this->assertEquals( 0, $sites->count() );