public function testLogWithInvalidNameLengthThrowsException() { $manualEntryLogger = $this->getMockBuilder('\\SMW\\MediaWiki\\ManualEntryLogger')->disableOriginalConstructor()->getMock(); $manualEntryLogger->expects($this->never())->method('log'); $instance = new MaintenanceLogger('Foo', $manualEntryLogger); $instance->setMaxNameChars(2); $this->setExpectedException('RuntimeException'); $instance->log('bar'); }
/** * @since 2.4 * * @param string $performer * * @return MaintenanceLogger */ public function newMaintenanceLogger($performer) { $maintenanceLogger = new MaintenanceLogger($performer, new ManualEntryLogger()); $maintenanceLogger->setMaxNameChars($GLOBALS['wgMaxNameChars']); return $maintenanceLogger; }