mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-23 15:36:58 +00:00
tests: Namespace the PHP classes
This might make dependencies easier to find. Change-Id: I158fd9f63f18a2b8da0368ac95d5fb5aa9bca3ff
This commit is contained in:
parent
7f9637e543
commit
291ea47dd3
|
@ -1153,8 +1153,8 @@
|
|||
"MediaWiki\\Extension\\Notifications\\": "includes/"
|
||||
},
|
||||
"TestAutoloadClasses": {
|
||||
"EchoAbstractMapperStub": "tests/phpunit/Mapper/EchoAbstractMapperStub.php",
|
||||
"EchoExecuteFirstArgumentStub": "tests/phpunit/Mapper/EchoExecuteFirstArgumentStub.php"
|
||||
"MediaWiki\\Extension\\Notifications\\Test\\EchoAbstractMapperStub": "tests/phpunit/Mapper/EchoAbstractMapperStub.php",
|
||||
"MediaWiki\\Extension\\Notifications\\Test\\Integration\\Mapper\\EchoExecuteFirstArgumentStub": "tests/phpunit/Mapper/EchoExecuteFirstArgumentStub.php"
|
||||
},
|
||||
"TestAutoloadNamespaces": {
|
||||
"MediaWiki\\Extension\\Notifications\\Test\\": "tests/phpunit/",
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Notifications\Test\API;
|
||||
|
||||
use MediaWiki\Tests\Api\ApiTestCase;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Notifications\Test\API;
|
||||
|
||||
use MediaWiki\Tests\Api\ApiTestCase;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Notifications\Test\API;
|
||||
|
||||
use MediaWiki\Api\ApiUsageException;
|
||||
use MediaWiki\Extension\Notifications\Push\Utils;
|
||||
use MediaWiki\Extension\Notifications\Services;
|
||||
use MediaWiki\Tests\Api\ApiTestCase;
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Notifications\Test\API;
|
||||
|
||||
use MediaWiki\Api\ApiUsageException;
|
||||
use MediaWiki\Extension\Notifications\Push\Utils;
|
||||
use MediaWiki\Extension\Notifications\Services;
|
||||
use MediaWiki\Tests\Api\ApiTestCase;
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Notifications\Test\API;
|
||||
|
||||
use MediaWiki\Api\ApiUsageException;
|
||||
use MediaWiki\Tests\Api\ApiTestCase;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Notifications\Test\Cache;
|
||||
|
||||
use MediaWiki\Extension\Notifications\Cache\TitleLocalCache;
|
||||
use MediaWiki\Title\Title;
|
||||
use MediaWikiIntegrationTestCase;
|
||||
use Wikimedia\TestingAccessWrapper;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Notifications\Test\Controller;
|
||||
|
||||
use MapCacheLRU;
|
||||
use MediaWiki\Extension\Notifications\AttributeManager;
|
||||
use MediaWiki\Extension\Notifications\Controller\NotificationController;
|
||||
use MediaWiki\Extension\Notifications\Model\Event;
|
||||
|
@ -8,6 +11,7 @@ use MediaWiki\Title\Title;
|
|||
use MediaWiki\User\Options\UserOptionsLookup;
|
||||
use MediaWiki\User\User;
|
||||
use MediaWiki\Utils\MWTimestamp;
|
||||
use MediaWikiIntegrationTestCase;
|
||||
use Wikimedia\TestingAccessWrapper;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Notifications\Test;
|
||||
|
||||
use MediaWiki\Extension\Notifications\DbFactory;
|
||||
use MediaWikiIntegrationTestCase;
|
||||
use ReflectionClass;
|
||||
use Wikimedia\Rdbms\IDatabase;
|
||||
use Wikimedia\Rdbms\ILoadBalancer;
|
||||
|
||||
|
|
|
@ -1,15 +1,21 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Notifications\Test;
|
||||
|
||||
// phpcs:disable Generic.Files.LineLength -- Long html test examples
|
||||
|
||||
use MediaWiki\CommentStore\CommentStoreComment;
|
||||
use MediaWiki\Content\WikitextContent;
|
||||
use MediaWiki\Extension\Notifications\DiscussionParser;
|
||||
use MediaWiki\Extension\Notifications\Model\Event;
|
||||
use MediaWiki\MainConfigNames;
|
||||
use MediaWiki\Registration\ExtensionRegistry;
|
||||
use MediaWiki\Revision\MutableRevisionRecord;
|
||||
use MediaWiki\Revision\SlotRecord;
|
||||
use MediaWiki\Title\Title;
|
||||
use MediaWiki\User\User;
|
||||
use MediaWikiIntegrationTestCase;
|
||||
use ReflectionObject;
|
||||
use Wikimedia\TestingAccessWrapper;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Notifications\Test;
|
||||
|
||||
use MediaWiki\Extension\Notifications\Hooks as EchoHooks;
|
||||
use MediaWiki\Extension\Notifications\Services;
|
||||
use MediaWiki\MainConfigNames;
|
||||
use MediaWikiIntegrationTestCase;
|
||||
|
||||
class EchoHooksTest extends MediaWikiIntegrationTestCase {
|
||||
/**
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Notifications\Test\Formatters;
|
||||
|
||||
use MediaWiki\Extension\Notifications\Formatters\EchoPresentationModelSection;
|
||||
use MediaWiki\Extension\Notifications\Model\Event;
|
||||
use MediaWikiIntegrationTestCase;
|
||||
|
||||
/**
|
||||
* @covers \MediaWiki\Extension\Notifications\Formatters\EchoPresentationModelSection
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Notifications\Test;
|
||||
|
||||
use MediaWiki\Extension\Notifications\Mapper\AbstractMapper;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Notifications\Test\Integration\Mapper;
|
||||
|
||||
use PHPUnit\Framework\MockObject\Invocation;
|
||||
use PHPUnit\Framework\MockObject\Invocation\StaticInvocation;
|
||||
use PHPUnit\Framework\MockObject\Stub\Stub;
|
||||
|
@ -7,10 +9,10 @@ use PHPUnit\Framework\MockObject\Stub\Stub;
|
|||
class EchoExecuteFirstArgumentStub implements Stub {
|
||||
public function invoke( Invocation $invocation ) {
|
||||
if ( !$invocation instanceof StaticInvocation ) {
|
||||
throw new PHPUnit\Framework\Exception( 'wrong invocation type' );
|
||||
throw new \PHPUnit\Framework\Exception( 'wrong invocation type' );
|
||||
}
|
||||
if ( !$invocation->arguments ) {
|
||||
throw new PHPUnit\Framework\Exception( 'Method call must have an argument' );
|
||||
throw new \PHPUnit\Framework\Exception( 'Method call must have an argument' );
|
||||
}
|
||||
|
||||
return call_user_func( reset( $invocation->arguments ) );
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Notifications\Test\Integration\Mapper;
|
||||
|
||||
use InvalidArgumentException;
|
||||
use MediaWiki\Extension\Notifications\DbFactory;
|
||||
use MediaWiki\Extension\Notifications\Mapper\EventMapper;
|
||||
use MediaWiki\Extension\Notifications\Model\Event;
|
||||
use MediaWikiIntegrationTestCase;
|
||||
use Wikimedia\Rdbms\FakeResultWrapper;
|
||||
use Wikimedia\Rdbms\IDatabase;
|
||||
use Wikimedia\Rdbms\InsertQueryBuilder;
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Notifications\Test\Integration\Mapper;
|
||||
|
||||
use MediaWiki\Extension\Notifications\DbFactory;
|
||||
use MediaWiki\Extension\Notifications\Mapper\NotificationMapper;
|
||||
use MediaWiki\Extension\Notifications\Model\Notification;
|
||||
use MediaWiki\MainConfigNames;
|
||||
use MediaWiki\User\User;
|
||||
use MediaWikiIntegrationTestCase;
|
||||
use Wikimedia\Rdbms\DeleteQueryBuilder;
|
||||
use Wikimedia\Rdbms\FakeResultWrapper;
|
||||
use Wikimedia\Rdbms\IDatabase;
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Notifications\Test\Integration\Model;
|
||||
|
||||
use InvalidArgumentException;
|
||||
use MediaWiki\Extension\Notifications\Model\Event;
|
||||
use MediaWiki\Extension\Notifications\Model\Notification;
|
||||
use MediaWiki\Extension\Notifications\Model\TargetPage;
|
||||
use MediaWikiIntegrationTestCase;
|
||||
use Wikimedia\Rdbms\IDatabase;
|
||||
use Wikimedia\Rdbms\ILoadBalancer;
|
||||
use Wikimedia\Rdbms\LBFactory;
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Notifications\Test;
|
||||
|
||||
use Exception;
|
||||
use MediaWiki\Extension\Notifications\EmailFormat;
|
||||
use MediaWiki\Extension\Notifications\Gateway\UserNotificationGateway;
|
||||
use MediaWiki\Extension\Notifications\Mapper\NotificationMapper;
|
||||
|
@ -13,6 +16,8 @@ use MediaWiki\User\TalkPageNotificationManager;
|
|||
use MediaWiki\User\User;
|
||||
use MediaWiki\User\UserFactory;
|
||||
use MediaWiki\User\UserGroupManager;
|
||||
use MediaWikiIntegrationTestCase;
|
||||
use Wikimedia\ObjectCache\WANObjectCache;
|
||||
use Wikimedia\Rdbms\IDatabase;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Notifications\Test;
|
||||
|
||||
use MediaWikiIntegrationTestCase;
|
||||
|
||||
class NotificationStructureTest extends MediaWikiIntegrationTestCase {
|
||||
/**
|
||||
* @coversNothing
|
||||
|
|
|
@ -1,11 +1,14 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Notifications\Test;
|
||||
|
||||
use MediaWiki\Context\DerivativeContext;
|
||||
use MediaWiki\Context\RequestContext;
|
||||
use MediaWiki\Extension\Notifications\Mapper\NotificationMapper;
|
||||
use MediaWiki\Extension\Notifications\Model\Event;
|
||||
use MediaWiki\User\User;
|
||||
use MediaWiki\User\UserIdentity;
|
||||
use MediaWikiIntegrationTestCase;
|
||||
|
||||
/**
|
||||
* Tests for the built in notification types
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Notifications\Test;
|
||||
|
||||
use MediaWiki\Extension\Notifications\SummaryParser;
|
||||
use MediaWiki\User\User;
|
||||
use MediaWiki\User\UserIdentity;
|
||||
use MediaWikiIntegrationTestCase;
|
||||
|
||||
/**
|
||||
* @group Echo
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Notifications\Test;
|
||||
|
||||
use MediaWiki\Extension\Notifications\Model\Event;
|
||||
use MediaWiki\Tests\Api\ApiTestCase;
|
||||
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Notifications\Test;
|
||||
|
||||
use MediaWiki\Extension\Notifications\DbFactory;
|
||||
use MediaWiki\Extension\Notifications\Mapper\NotificationMapper;
|
||||
use MediaWiki\Title\Title;
|
||||
use MediaWikiIntegrationTestCase;
|
||||
use Wikimedia\Rdbms\Platform\ISQLPlatform;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Notifications\Test;
|
||||
|
||||
use MediaWiki\Extension\Notifications\DbFactory;
|
||||
use MediaWiki\Extension\Notifications\UnreadWikis;
|
||||
use MediaWiki\Utils\MWTimestamp;
|
||||
use MediaWikiIntegrationTestCase;
|
||||
use Wikimedia\TestingAccessWrapper;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Notifications\Test\Integration\Push;
|
||||
|
||||
use MediaWiki\Extension\Notifications\Services;
|
||||
use MediaWikiIntegrationTestCase;
|
||||
use MockHttpTrait;
|
||||
use MWHttpRequest;
|
||||
use Wikimedia\TestingAccessWrapper;
|
||||
|
||||
/** @covers \MediaWiki\Extension\Notifications\Push\NotificationServiceClient */
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Notifications\Test\Integration\Push;
|
||||
|
||||
use MediaWiki\Extension\Notifications\Push\NotificationRequestJob;
|
||||
use MediaWiki\Extension\Notifications\Push\PushNotifier;
|
||||
use MediaWiki\User\CentralId\CentralIdLookup;
|
||||
use MediaWiki\User\User;
|
||||
use MediaWikiIntegrationTestCase;
|
||||
use Wikimedia\TestingAccessWrapper;
|
||||
|
||||
/** @covers \MediaWiki\Extension\Notifications\Push\PushNotifier */
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Notifications\Test\Integration\Push;
|
||||
|
||||
use MediaWiki\Extension\Notifications\Push\Utils;
|
||||
use MediaWiki\Extension\Notifications\Services;
|
||||
use MediaWikiIntegrationTestCase;
|
||||
use Wikimedia\TestingAccessWrapper;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Notifications\Test\Integration\Push;
|
||||
|
||||
use MediaWiki\Extension\Notifications\Push\Utils;
|
||||
use MediaWikiIntegrationTestCase;
|
||||
|
||||
/**
|
||||
* @covers \MediaWiki\Extension\Notifications\Push\Utils
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Notifications\Test\Maintenance;
|
||||
|
||||
use MediaWiki\Extension\Notifications\SuppressionRowUpdateGenerator;
|
||||
use MediaWiki\Title\Title;
|
||||
use MediaWikiIntegrationTestCase;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Notifications\Test\Unit;
|
||||
|
||||
use MediaWiki\Extension\Notifications\AttributeManager;
|
||||
use MediaWiki\User\Options\UserOptionsLookup;
|
||||
use MediaWiki\User\UserGroupManager;
|
||||
use MediaWiki\User\UserIdentity;
|
||||
use MediaWiki\User\UserIdentityValue;
|
||||
use MediaWikiUnitTestCase;
|
||||
|
||||
/**
|
||||
* @covers \MediaWiki\Extension\Notifications\AttributeManager
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Notifications\Test\Unit;
|
||||
|
||||
use MediaWiki\Extension\Notifications\Bundler;
|
||||
use MediaWiki\Extension\Notifications\Model\Notification;
|
||||
use MediaWikiUnitTestCase;
|
||||
|
||||
/**
|
||||
* @covers \MediaWiki\Extension\Notifications\Bundler
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Notifications\Test\Unit;
|
||||
|
||||
use MediaWiki\Extension\Notifications\DiscussionParser;
|
||||
use MediaWikiUnitTestCase;
|
||||
|
||||
/**
|
||||
* @covers \MediaWiki\Extension\Notifications\DiffParser
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Notifications\Test\Unit;
|
||||
|
||||
use MediaWiki\Config\HashConfig;
|
||||
use MediaWiki\Extension\Notifications\DbFactory;
|
||||
use MediaWiki\Extension\Notifications\Gateway\UserNotificationGateway;
|
||||
use MediaWiki\User\User;
|
||||
use MediaWikiUnitTestCase;
|
||||
use Wikimedia\Rdbms\FakeResultWrapper;
|
||||
use Wikimedia\Rdbms\IDatabase;
|
||||
use Wikimedia\Rdbms\SelectQueryBuilder;
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Notifications\Test\Unit;
|
||||
|
||||
use ArrayIterator;
|
||||
use MediaWiki\Extension\Notifications\Iterator\CallbackIterator;
|
||||
use MediaWiki\Extension\Notifications\Iterator\FilteredSequentialIterator;
|
||||
use MediaWikiUnitTestCase;
|
||||
|
||||
/**
|
||||
* @covers \MediaWiki\Extension\Notifications\Iterator\CallbackIterator
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Notifications\Test\Unit;
|
||||
|
||||
use InvalidArgumentException;
|
||||
use MediaWiki\Extension\Notifications\Mapper\AbstractMapper;
|
||||
use MediaWiki\Extension\Notifications\Test\EchoAbstractMapperStub;
|
||||
use MediaWikiUnitTestCase;
|
||||
use ReflectionClass;
|
||||
|
||||
/**
|
||||
* @covers \MediaWiki\Extension\Notifications\Mapper\AbstractMapper
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Notifications\Test\Unit;
|
||||
|
||||
use MediaWiki\Extension\Notifications\DbFactory;
|
||||
use MediaWiki\Extension\Notifications\Mapper\TargetPageMapper;
|
||||
use MediaWiki\Extension\Notifications\Model\TargetPage;
|
||||
use MediaWikiUnitTestCase;
|
||||
use Wikimedia\Rdbms\FakeResultWrapper;
|
||||
use Wikimedia\Rdbms\IDatabase;
|
||||
use Wikimedia\Rdbms\InsertQueryBuilder;
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Notifications\Test\Unit;
|
||||
|
||||
use InvalidArgumentException;
|
||||
use MediaWiki\Extension\Notifications\Model\Event;
|
||||
use MediaWiki\Extension\Notifications\Model\TargetPage;
|
||||
use MediaWiki\Title\Title;
|
||||
use MediaWikiUnitTestCase;
|
||||
|
||||
/**
|
||||
* @covers \MediaWiki\Extension\Notifications\Model\TargetPage
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Notifications\Test\Unit;
|
||||
|
||||
use MediaWiki\Extension\Notifications\Push\NotificationServiceClient;
|
||||
use MediaWiki\Extension\Notifications\Push\Subscription;
|
||||
use MediaWikiUnitTestCase;
|
||||
|
||||
/** @covers \MediaWiki\Extension\Notifications\Push\NotificationServiceClient */
|
||||
class NotificationServiceClientUnitTest extends MediaWikiUnitTestCase {
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Notifications\Test\Unit;
|
||||
|
||||
use MediaWiki\Extension\Notifications\Push\Subscription;
|
||||
use MediaWikiUnitTestCase;
|
||||
use Wikimedia\Timestamp\ConvertibleTimestamp;
|
||||
|
||||
/** @covers \MediaWiki\Extension\Notifications\Push\Subscription */
|
||||
|
|
Loading…
Reference in a new issue