MediaWiki REL1_33
ExternalStoreFactoryTest.php
Go to the documentation of this file.
1<?php
2
6class ExternalStoreFactoryTest extends PHPUnit\Framework\TestCase {
7
8 use MediaWikiCoversValidator;
9
11 $factory = new ExternalStoreFactory( [] );
12 $this->assertFalse( $factory->getStoreObject( 'ForTesting' ) );
13 $this->assertFalse( $factory->getStoreObject( 'foo' ) );
14 }
15
16 public function provideStoreNames() {
17 yield 'Same case as construction' => [ 'ForTesting' ];
18 yield 'All lower case' => [ 'fortesting' ];
19 yield 'All upper case' => [ 'FORTESTING' ];
20 yield 'Mix of cases' => [ 'FOrTEsTInG' ];
21 }
22
27 $factory = new ExternalStoreFactory( [ 'ForTesting' ] );
28 $store = $factory->getStoreObject( $proto );
29 $this->assertInstanceOf( ExternalStoreForTesting::class, $store );
30 }
31
36 $factory = new ExternalStoreFactory( [ 'SomeOtherClassName' ] );
37 $store = $factory->getStoreObject( $proto );
38 $this->assertFalse( $store );
39 }
40
41}
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
testExternalStoreFactory_someStore_noProtoMatch( $proto)
provideStoreNames
testExternalStoreFactory_someStore_protoMatch( $proto)
provideStoreNames