3 use MediaWiki\Title\Title
;
4 use MediaWiki\User\User
;
7 * Integration test for T277618.
9 * Add @noVarDump annotations to large properties if these tests fail.
14 class DumpableObjectsTest
extends MediaWikiIntegrationTestCase
{
15 private function dumpSize( $object ) {
18 static function ( $buffer ) use ( &$n ) {
19 $n +
= strlen( $buffer );
28 public function testUser() {
30 $u->isAllowed( 'read' );
31 $this->assertLessThan( 100000, $this->dumpSize( $u ) );
34 public function testTitle() {
35 $object = Title
::makeTitle( NS_MAIN
, 'Test' );
36 $this->assertLessThan( 100000, $this->dumpSize( $object ) );
39 public function testLanguage() {
40 $object = \MediaWiki\MediaWikiServices
::getInstance()->getLanguageFactory()->getLanguage( 'en' );
41 $this->assertLessThan( 100000, $this->dumpSize( $object ) );
44 public function testMessage() {
45 $object = wfMessage( 'jan' );
46 $this->assertLessThan( 100000, $this->dumpSize( $object ) );