for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace SWL\Tests\Integration;
use SMW\Tests\Utils\UtilityFactory;
/**
* @group semantic-watchlist
*
* @group medium
* @license GNU GPL v2+
* @since 1.0
* @author mwjames
*/
class I18nJsonFileIntegrityTest extends \PHPUnit_Framework_TestCase {
public function setUp() {
if ( !class_exists( UtilityFactory::class ) ) {
// FIXME: should not depend on non-production class of another package
$this->markTestSkipped( 'SMW\Tests\Utils\UtilityFactory is not available' );
}
* @dataProvider i18nFileProvider
public function testI18NJsonDecodeEncode( $file ) {
$jsonFileReader = UtilityFactory::getInstance()->newJsonFileReader( $file );
$this->assertInternalType(
'integer',
$jsonFileReader->getModificationTime()
);
'array',
$jsonFileReader->read()
public function i18nFileProvider() {
$provider = array();
$location = $GLOBALS['wgMessagesDirs']['SemanticWatchlist'];
$bulkFileProvider = UtilityFactory::getInstance()->newBulkFileProvider( $location );
$bulkFileProvider->searchByFileExtension( 'json' );
foreach ( $bulkFileProvider->getFiles() as $file ) {
$provider[] = array( $file );
return $provider;