40 foreach ( $sitesArrays
as $sitesArray ) {
41 $listInstances[] =
new SiteList( $sitesArray[0] );
44 return $this->
arrayWrap( $listInstances );
56 $siteArrays[] = $sites;
58 $siteArrays[] = [ array_shift( $sites ) ];
60 $siteArrays[] = [ array_shift( $sites ), array_shift( $sites ) ];
71 $this->assertEquals(
count( $sites ) === 0, $sites->
isEmpty() );
83 foreach ( $sites
as $site ) {
84 $this->assertEquals( $site, $sites->
getSite( $site->getGlobalId() ) );
87 $this->assertTrue(
true );
99 foreach ( $sites
as $site ) {
100 if ( is_int( $site->getInternalId() ) ) {
101 $this->assertEquals( $site, $sites->getSiteByInternalId( $site->getInternalId() ) );
105 $this->assertTrue(
true );
117 foreach ( $sites
as $site ) {
118 $ids = $site->getNavigationIds();
119 foreach ( $ids
as $navId ) {
120 $this->assertEquals( $site, $sites->getSiteByNavigationId( $navId ) );
124 $this->assertTrue(
true );
133 $this->assertFalse( $sites->hasSite(
'non-existing-global-id' ) );
134 $this->assertFalse( $sites->hasInternalId( 720101010 ) );
136 if ( !$sites->isEmpty() ) {
140 foreach ( $sites
as $site ) {
141 $this->assertTrue( $sites->hasSite( $site->getGlobalId() ) );
155 foreach ( $sites
as $site ) {
156 if ( is_int( $site->getInternalId() ) ) {
157 $this->assertTrue( $site, $sites->hasInternalId( $site->getInternalId() ) );
161 $this->assertFalse( $sites->hasInternalId( -1 ) );
173 foreach ( $sites
as $site ) {
174 $ids = $site->getNavigationIds();
175 foreach ( $ids
as $navId ) {
176 $this->assertTrue( $sites->hasNavigationId( $navId ) );
180 $this->assertFalse( $sites->hasNavigationId(
'non-existing-navigation-id' ) );
191 $this->assertTrue( is_array( $identifiers ) );
198 foreach ( $sites
as $site ) {
199 $expected[] = $site->getGlobalId();
226 foreach ( $list
as $site ) {
227 $this->assertTrue( $copy->hasInternalId( $site->getInternalId() ) );
229 foreach ( $site->getNavigationIds()
as $navId ) {
231 $copy->hasNavigationId( $navId ),
232 'unserialized data expects nav id ' . $navId .
' for site ' . $site->getGlobalId()