Move ResultWrapper subclasses to Rdbms
[mediawiki.git] / tests / phpunit / includes / debug / logger / MonologSpiTest.php
blob0ee7d2688452e414adc01ccce6d4147e90e6a512
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 MediaWiki\Logger\MonologSpi::mergeConfig
31 public function testMergeConfig() {
32 $base = [
33 'loggers' => [
34 '@default' => [
35 'processors' => [ 'constructor' ],
36 'handlers' => [ 'constructor' ],
39 'processors' => [
40 'constructor' => [
41 'class' => 'constructor',
44 'handlers' => [
45 'constructor' => [
46 'class' => 'constructor',
47 'formatter' => 'constructor',
50 'formatters' => [
51 'constructor' => [
52 'class' => 'constructor',
57 $fixture = new MonologSpi( $base );
58 $this->assertSame(
59 $base,
60 TestingAccessWrapper::newFromObject( $fixture )->config
63 $fixture->mergeConfig( [
64 'loggers' => [
65 'merged' => [
66 'processors' => [ 'merged' ],
67 'handlers' => [ 'merged' ],
70 'processors' => [
71 'merged' => [
72 'class' => 'merged',
75 'magic' => [
76 'idkfa' => [ 'xyzzy' ],
78 'handlers' => [
79 'merged' => [
80 'class' => 'merged',
81 'formatter' => 'merged',
84 'formatters' => [
85 'merged' => [
86 'class' => 'merged',
89 ] );
90 $this->assertSame(
92 'loggers' => [
93 '@default' => [
94 'processors' => [ 'constructor' ],
95 'handlers' => [ 'constructor' ],
97 'merged' => [
98 'processors' => [ 'merged' ],
99 'handlers' => [ 'merged' ],
102 'processors' => [
103 'constructor' => [
104 'class' => 'constructor',
106 'merged' => [
107 'class' => 'merged',
110 'handlers' => [
111 'constructor' => [
112 'class' => 'constructor',
113 'formatter' => 'constructor',
115 'merged' => [
116 'class' => 'merged',
117 'formatter' => 'merged',
120 'formatters' => [
121 'constructor' => [
122 'class' => 'constructor',
124 'merged' => [
125 'class' => 'merged',
128 'magic' => [
129 'idkfa' => [ 'xyzzy' ],
132 TestingAccessWrapper::newFromObject( $fixture )->config