Import: Handle uploads with sha1 starting with 0 properly
[mediawiki.git] / tests / phpunit / includes / debug / logger / MonologSpiTest.php
blobaa0a54ffd6c0ea2b95a7bcf256f1bc989b20079b
1 <?php
2 /**
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 * http://www.gnu.org/copyleft/gpl.html
18 * @file
21 namespace MediaWiki\Logger;
23 use MediaWikiTestCase;
24 use TestingAccessWrapper;
26 class MonologSpiTest extends MediaWikiTestCase {
28 /**
29 * @covers MonologSpi::mergeConfig
31 public function testMergeConfig() {
32 $base = array(
33 'loggers' => array(
34 '@default' => array(
35 'processors' => array( 'constructor' ),
36 'handlers' => array( 'constructor' ),
39 'processors' => array(
40 'constructor' => array(
41 'class' => 'constructor',
44 'handlers' => array(
45 'constructor' => array(
46 'class' => 'constructor',
47 'formatter' => 'constructor',
50 'formatters' => array(
51 'constructor' => array(
52 'class' => 'constructor',
57 $fixture = new MonologSpi( $base );
58 $this->assertSame(
59 $base,
60 TestingAccessWrapper::newFromObject( $fixture )->config
63 $fixture->mergeConfig( array(
64 'loggers' => array(
65 'merged' => array(
66 'processors' => array( 'merged' ),
67 'handlers' => array( 'merged' ),
70 'processors' => array(
71 'merged' => array(
72 'class' => 'merged',
75 'magic' => array(
76 'idkfa' => array( 'xyzzy' ),
78 'handlers' => array(
79 'merged' => array(
80 'class' => 'merged',
81 'formatter' => 'merged',
84 'formatters' => array(
85 'merged' => array(
86 'class' => 'merged',
89 ) );
90 $this->assertSame(
91 array(
92 'loggers' => array(
93 '@default' => array(
94 'processors' => array( 'constructor' ),
95 'handlers' => array( 'constructor' ),
97 'merged' => array(
98 'processors' => array( 'merged' ),
99 'handlers' => array( 'merged' ),
102 'processors' => array(
103 'constructor' => array(
104 'class' => 'constructor',
106 'merged' => array(
107 'class' => 'merged',
110 'handlers' => array(
111 'constructor' => array(
112 'class' => 'constructor',
113 'formatter' => 'constructor',
115 'merged' => array(
116 'class' => 'merged',
117 'formatter' => 'merged',
120 'formatters' => array(
121 'constructor' => array(
122 'class' => 'constructor',
124 'merged' => array(
125 'class' => 'merged',
128 'magic' => array(
129 'idkfa' => array( 'xyzzy' ),
132 TestingAccessWrapper::newFromObject( $fixture )->config