MediaWiki
REL1_31
ExternalStoreFactoryTest.php
Go to the documentation of this file.
1
<?php
2
6
class
ExternalStoreFactoryTest
extends
PHPUnit\Framework\TestCase {
7
8
use MediaWikiCoversValidator;
9
10
public
function
testExternalStoreFactory_noStores
() {
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
26
public
function
testExternalStoreFactory_someStore_protoMatch
( $proto ) {
27
$factory =
new
ExternalStoreFactory
( [
'ForTesting'
] );
28
$store = $factory->getStoreObject( $proto );
29
$this->assertInstanceOf( ExternalStoreForTesting::class, $store );
30
}
31
35
public
function
testExternalStoreFactory_someStore_noProtoMatch
( $proto ) {
36
$factory =
new
ExternalStoreFactory
( [
'SomeOtherClassName'
] );
37
$store = $factory->getStoreObject( $proto );
38
$this->assertFalse( $store );
39
}
40
41
}
ExternalStoreFactoryTest
ExternalStoreFactory.
Definition
ExternalStoreFactoryTest.php:6
ExternalStoreFactoryTest\testExternalStoreFactory_noStores
testExternalStoreFactory_noStores()
Definition
ExternalStoreFactoryTest.php:10
ExternalStoreFactoryTest\testExternalStoreFactory_someStore_noProtoMatch
testExternalStoreFactory_someStore_noProtoMatch( $proto)
provideStoreNames
Definition
ExternalStoreFactoryTest.php:35
ExternalStoreFactoryTest\provideStoreNames
provideStoreNames()
Definition
ExternalStoreFactoryTest.php:16
ExternalStoreFactoryTest\testExternalStoreFactory_someStore_protoMatch
testExternalStoreFactory_someStore_protoMatch( $proto)
provideStoreNames
Definition
ExternalStoreFactoryTest.php:26
ExternalStoreFactory
Definition
ExternalStoreFactory.php:9
tests
phpunit
includes
externalstore
ExternalStoreFactoryTest.php
Generated on Mon Nov 25 2024 15:36:21 for MediaWiki by
1.10.0