use MediaWiki\Session\SessionManager;
class FauxRequestTest extends PHPUnit_Framework_TestCase {
+
+ use MediaWikiCoversValidator;
+
/**
* @covers FauxRequest::__construct
*/
$this->assertEquals( '', $req->getText( 'z' ) );
}
- // Integration test for parent method.
+ /**
+ * Integration test for parent method
+ * @covers FauxRequest::getVal
+ */
public function testGetVal() {
$req = new FauxRequest( [ 'crlf' => "A\r\nb" ] );
$this->assertSame( "A\r\nb", $req->getVal( 'crlf' ), 'CRLF' );
}
- // Integration test for parent method.
+ /**
+ * Integration test for parent method
+ * @covers FauxRequest::getRawVal
+ */
public function testGetRawVal() {
$req = new FauxRequest( [
'x' => 'Value',
<?php
+ /**
+ * @covers HTMLRestrictionsField
+ */
class HTMLRestrictionsFieldTest extends PHPUnit_Framework_TestCase {
+
+ use MediaWikiCoversValidator;
+
public function testConstruct() {
$field = new HTMLRestrictionsField( [ 'fieldname' => 'restrictions' ] );
$this->assertNotEmpty( $field->getLabel(), 'has a default label' );
<?php
+ /**
+ * @covers DeferredStringifier
+ */
class DeferredStringifierTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
/**
- * @covers DeferredStringifier
* @dataProvider provideToString
*/
public function testToString( $params, $expected ) {
<?php
+ /**
+ * @covers DnsSrvDiscoverer
+ */
class DnsSrvDiscovererTest extends PHPUnit_Framework_TestCase {
+
+ use MediaWikiCoversValidator;
+
/**
- * @covers DnsSrvDiscoverer
* @dataProvider provideRecords
*/
public function testPickServer( $params, $expected ) {
*/
class IPTest extends PHPUnit_Framework_TestCase {
+
+ use MediaWikiCoversValidator;
+
/**
* @covers IP::isIPAddress
* @dataProvider provideInvalidIPs
}
/**
- * Test for IP::splitHostAndPort().
+ * @covers IP::splitHostAndPort()
* @dataProvider provideSplitHostAndPort
*/
public function testSplitHostAndPort( $expected, $input, $description ) {
}
/**
- * Test for IP::combineHostAndPort()
+ * @covers IP::combineHostAndPort()
* @dataProvider provideCombineHostAndPort
*/
public function testCombineHostAndPort( $expected, $input, $description ) {
}
/**
- * Test for IP::sanitizeRange()
+ * @covers IP::sanitizeRange()
* @dataProvider provideIPCIDRs
*/
public function testSanitizeRange( $input, $expected, $description ) {
}
/**
- * Test for IP::prettifyIP()
+ * @covers IP::prettifyIP()
* @dataProvider provideIPsToPrettify
*/
public function testPrettifyIP( $ip, $prettified ) {
*/
class ProcessCacheLRUTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
/**
* Helper to verify emptiness of a cache object.
* Compare against an array so we get the cache content difference.
/**
* Highlight diff between assertEquals and assertNotSame
+ * @coversNothing
*/
public function testPhpUnitArrayEquality() {
$one = [ 'A' => 1, 'B' => 2 ];
use Liuggio\StatsdClient\Entity\StatsdData;
use Liuggio\StatsdClient\Sender\SenderInterface;
+ /**
+ * @covers SamplingStatsdClient
+ */
class SamplingStatsdClientTest extends PHPUnit_Framework_TestCase {
+
+ use MediaWikiCoversValidator;
+
/**
* @dataProvider samplingDataProvider
*/
<?php
- /*
+ /**
* @group Media
* @covers MimeAnalyzer
*/
class MimeAnalyzerTest extends PHPUnit_Framework_TestCase {
+
+ use MediaWikiCoversValidator;
+
/** @var MimeAnalyzer */
private $mimeAnalyzer;
use Wikimedia\Rdbms\TransactionProfiler;
use Psr\Log\LoggerInterface;
+ /**
+ * @covers \Wikimedia\Rdbms\TransactionProfiler
+ */
class TransactionProfilerTest extends PHPUnit_Framework_TestCase {
+
+ use MediaWikiCoversValidator;
+
public function testAffected() {
$logger = $this->getMockBuilder( LoggerInterface::class )->getMock();
$logger->expects( $this->exactly( 3 ) )->method( 'info' );
* dataprovider.
*/
+ /**
+ * @covers AvroValidator
+ */
class AvroValidatorTest extends PHPUnit_Framework_TestCase {
+
+ use MediaWikiCoversValidator;
+
public function setUp() {
if ( !class_exists( 'AvroSchema' ) ) {
$this->markTestSkipped( 'Avro is required to run the AvroValidatorTest' );
<?php
+
/**
- *
* @group Hash
+ *
+ * @covers MWCryptHash
*/
-
class MWCryptHashTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
public function testHashLength() {
if ( MWCryptHash::hashAlgo() !== 'whirlpool' ) {
$this->markTestSkipped( 'Hash algorithm isn\'t whirlpool' );
}
$data = 'foobar';
- // @codingStandardsIgnoreStart Generic.Files.LineLength
+ // phpcs:ignore Generic.Files.LineLength
$hash = '9923afaec3a86f865bb231a588f453f84e8151a2deb4109aebc6de4284be5bebcff4fab82a7e51d920237340a043736e9d13bab196006dcca0fe65314d68eab9';
- // @codingStandardsIgnoreEnd
$this->assertEquals(
hex2bin( $hash ),
$data = 'foobar';
$key = 'secret';
- // @codingStandardsIgnoreStart Generic.Files.LineLength
+ // phpcs:ignore Generic.Files.LineLength
$hash = 'ddc94177b2020e55ce2049199fd9cc6327f416ff6dc621cc34cb43d9bec61d73372b4790c0e24957f565ecaf2d42821e6303619093e99cbe14a3b9250bda5f81';
- // @codingStandardsIgnoreEnd
$this->assertEquals(
hex2bin( $hash ),