Completed
Push — master ( 8b5a3c...b0cbd6 )
by cam
01:56
created
ecrire/tests/Config/DepotMetaPersoTest.php 2 patches
Indentation   +152 added lines, -152 removed lines patch added patch discarded remove patch
@@ -19,77 +19,77 @@  discard block
 block discarded – undo
19 19
 
20 20
 class DepotMetaPersoTest extends TestCase
21 21
 {
22
-	protected static $savedMeta;
23
-
24
-	// les bases de test
25
-	protected static $assoc;
26
-
27
-	protected static $serassoc;
28
-
29
-	public static function setUpBeforeClass(): void {
30
-		self::$savedMeta = $GLOBALS['meta'];
31
-		self::$assoc = [
32
-			'one' => 'element 1',
33
-			'two' => 'element 2',
34
-		];
35
-		self::$serassoc = serialize(self::$assoc);
36
-	}
37
-
38
-	public static function tearDownAfterClass(): void {
39
-		$GLOBALS['meta'] = self::$savedMeta;
40
-		unset($GLOBALS['toto']);
41
-	}
42
-
43
-	/**
44
-	 * lire_config meta
45
-	 */
46
-	public function testLireConfig1() {
47
-		include_spip('inc/config');
48
-		$meta = $GLOBALS['meta'];
49
-
50
-		$trouver_table = charger_fonction('trouver_table', 'base');
51
-		$this->assertArrayNotHasKey('toto', $GLOBALS, 'Une table spip_toto existe deja !');
52
-		$this->assertEmpty($trouver_table('spip_toto'), 'Une table spip_toto existe deja !');
53
-
54
-		// on flingue meta a juste nos donnees
55
-		$GLOBALS['meta'] = [
56
-			'dummy' => '',
57
-		];
58
-		$GLOBALS['toto'] = [
59
-			'zero' => 0,
60
-			'zeroc' => '0',
61
-			'chaine' => 'une chaine',
62
-			'assoc' => self::$assoc,
63
-			'serie' => self::$serassoc,
64
-		];
65
-
66
-		$essais = [];
67
-		$essais[] = [0, '/toto/zero'];
68
-		$essais[] = ['0', '/toto/zeroc'];
69
-		$essais[] = ['une chaine', '/toto/chaine'];
70
-		$essais[] = [self::$assoc, '/toto/assoc'];
71
-		$essais[] = [self::$assoc, '/toto/serie'];
72
-		$essais[] = [self::$serassoc, '/toto/serie', '', 0];
73
-		$essais[] = [null, '/toto/rien'];
74
-		$essais[] = ['defaut', '/toto/rien', 'defaut'];
75
-		$essais[] = [null, '/meta/chaine'];
76
-		$essais[] = [null, 'chaine'];
77
-
78
-		foreach ($essais as $k => $essai) {
79
-			$expected = array_shift($essai);
80
-			$this->assertEquals($expected, lire_config(...$essai), "Echec {$k} : lecture " . reset($essai));
81
-		}
82
-
83
-		$GLOBALS['meta'] = $meta;
84
-		unset($GLOBALS['toto']);
85
-	}
86
-
87
-	/**
88
-	 * ecrire_config meta
89
-	 */
90
-	#[Depends('testLireConfig1')]
91
-	public function testEcrireConfig() {
92
-		/*
22
+    protected static $savedMeta;
23
+
24
+    // les bases de test
25
+    protected static $assoc;
26
+
27
+    protected static $serassoc;
28
+
29
+    public static function setUpBeforeClass(): void {
30
+        self::$savedMeta = $GLOBALS['meta'];
31
+        self::$assoc = [
32
+            'one' => 'element 1',
33
+            'two' => 'element 2',
34
+        ];
35
+        self::$serassoc = serialize(self::$assoc);
36
+    }
37
+
38
+    public static function tearDownAfterClass(): void {
39
+        $GLOBALS['meta'] = self::$savedMeta;
40
+        unset($GLOBALS['toto']);
41
+    }
42
+
43
+    /**
44
+     * lire_config meta
45
+     */
46
+    public function testLireConfig1() {
47
+        include_spip('inc/config');
48
+        $meta = $GLOBALS['meta'];
49
+
50
+        $trouver_table = charger_fonction('trouver_table', 'base');
51
+        $this->assertArrayNotHasKey('toto', $GLOBALS, 'Une table spip_toto existe deja !');
52
+        $this->assertEmpty($trouver_table('spip_toto'), 'Une table spip_toto existe deja !');
53
+
54
+        // on flingue meta a juste nos donnees
55
+        $GLOBALS['meta'] = [
56
+            'dummy' => '',
57
+        ];
58
+        $GLOBALS['toto'] = [
59
+            'zero' => 0,
60
+            'zeroc' => '0',
61
+            'chaine' => 'une chaine',
62
+            'assoc' => self::$assoc,
63
+            'serie' => self::$serassoc,
64
+        ];
65
+
66
+        $essais = [];
67
+        $essais[] = [0, '/toto/zero'];
68
+        $essais[] = ['0', '/toto/zeroc'];
69
+        $essais[] = ['une chaine', '/toto/chaine'];
70
+        $essais[] = [self::$assoc, '/toto/assoc'];
71
+        $essais[] = [self::$assoc, '/toto/serie'];
72
+        $essais[] = [self::$serassoc, '/toto/serie', '', 0];
73
+        $essais[] = [null, '/toto/rien'];
74
+        $essais[] = ['defaut', '/toto/rien', 'defaut'];
75
+        $essais[] = [null, '/meta/chaine'];
76
+        $essais[] = [null, 'chaine'];
77
+
78
+        foreach ($essais as $k => $essai) {
79
+            $expected = array_shift($essai);
80
+            $this->assertEquals($expected, lire_config(...$essai), "Echec {$k} : lecture " . reset($essai));
81
+        }
82
+
83
+        $GLOBALS['meta'] = $meta;
84
+        unset($GLOBALS['toto']);
85
+    }
86
+
87
+    /**
88
+     * ecrire_config meta
89
+     */
90
+    #[Depends('testLireConfig1')]
91
+    public function testEcrireConfig() {
92
+        /*
93 93
 		 * Notes sur l'ecriture :
94 94
 		 * - dans le tableau $GLOBALS['meta'], les valeurs transmises
95 95
 		 * conservent effectivement leur type
@@ -104,85 +104,85 @@  discard block
 block discarded – undo
104 104
 		 * tout ce qu'on lui donne (et peut donc restituer le type de donnee correctement).
105 105
 		 *
106 106
 		 */
107
-		$essais = [];
108
-		$essais[] = [true, '/toto/test_cfg_zero', 0];
109
-		$essais[] = [true, '/toto/test_cfg_zeroc', '0'];
110
-		$essais[] = [true, '/toto/test_cfg_chaine', 'une chaine'];
111
-		$essais[] = [true, '/toto/test_cfg_assoc', self::$assoc];
112
-		$essais[] = [true, '/toto/test_cfg_serie', self::$serassoc];
113
-
114
-		foreach ($essais as $k => $essai) {
115
-			$expected = array_shift($essai);
116
-			$this->assertEquals($expected, ecrire_config(...$essai), "Echec {$k} : ecriture " . reset($essai));
117
-		}
118
-
119
-		$trouver_table = charger_fonction('trouver_table', 'base');
120
-		$this->assertNotEmpty($GLOBALS['toto'], "La table spip_toto n'a pas ete cree !");
121
-		$this->assertNotEmpty($trouver_table('spip_toto'), "La table spip_toto n'a pas ete cree !");
122
-	}
123
-
124
-	/**
125
-	 * re lire_config meta
126
-	 */
127
-	#[Depends('testEcrireConfig')]
128
-	public function testLireConfig2() {
129
-		$essais = [];
130
-		$essais[] = [0, '/toto/test_cfg_zero'];
131
-		$essais[] = ['0', '/toto/test_cfg_zeroc'];
132
-		$essais[] = ['une chaine', '/toto/test_cfg_chaine'];
133
-		$essais[] = [self::$assoc, '/toto/test_cfg_assoc'];
134
-		$essais[] = [self::$serassoc, '/toto/test_cfg_serie', '', 0];
135
-
136
-		foreach ($essais as $k => $essai) {
137
-			$expected = array_shift($essai);
138
-			$this->assertEquals($expected, lire_config(...$essai), "Echec {$k} : lecture " . reset($essai));
139
-		}
140
-	}
141
-
142
-	/**
143
-	 * effacer_config meta
144
-	 */
145
-	#[Depends('testLireConfig2')]
146
-	public function testEffacerConfig() {
147
-		$essais = [];
148
-		$essais[] = [true, '/toto/test_cfg_zero'];
149
-		$essais[] = [true, '/toto/test_cfg_zeroc'];
150
-		$essais[] = [true, '/toto/test_cfg_chaine'];
151
-		$essais[] = [true, '/toto/test_cfg_assoc'];
152
-		$essais[] = [true, '/toto/test_cfg_serie'];
153
-
154
-		foreach ($essais as $k => $essai) {
155
-			$expected = array_shift($essai);
156
-			$this->assertEquals($expected, effacer_config(...$essai), "Echec {$k} : effacer " . reset($essai));
157
-		}
158
-	}
159
-
160
-	/**
161
-	 * re lire_config meta
162
-	 */
163
-	#[Depends('testEffacerConfig')]
164
-	public function testLireConfig3() {
165
-		$essais = [];
166
-		$essais[] = [null, '/toto/test_cfg_zero'];
167
-		$essais[] = [null, '/toto/test_cfg_zeroc'];
168
-		$essais[] = [null, '/toto/test_cfg_chaine'];
169
-		$essais[] = [null, '/toto/test_cfg_assoc'];
170
-		$essais[] = [null, '/toto/test_cfg_serie'];
171
-
172
-		foreach ($essais as $k => $essai) {
173
-			$expected = array_shift($essai);
174
-			$this->assertEquals($expected, lire_config(...$essai), "Echec {$k} : lecture " . reset($essai));
175
-		}
176
-
177
-		$trouver_table = charger_fonction('trouver_table', 'base');
178
-		$this->assertArrayNotHasKey(
179
-			'toto',
180
-			$GLOBALS,
181
-			"La table spip_toto n'a pas ete supprimee par le dernier effacement de config !"
182
-		);
183
-		$this->assertEmpty(
184
-			$trouver_table('spip_toto'),
185
-			"La table spip_toto n'a pas ete supprimee par le dernier effacement de config !"
186
-		);
187
-	}
107
+        $essais = [];
108
+        $essais[] = [true, '/toto/test_cfg_zero', 0];
109
+        $essais[] = [true, '/toto/test_cfg_zeroc', '0'];
110
+        $essais[] = [true, '/toto/test_cfg_chaine', 'une chaine'];
111
+        $essais[] = [true, '/toto/test_cfg_assoc', self::$assoc];
112
+        $essais[] = [true, '/toto/test_cfg_serie', self::$serassoc];
113
+
114
+        foreach ($essais as $k => $essai) {
115
+            $expected = array_shift($essai);
116
+            $this->assertEquals($expected, ecrire_config(...$essai), "Echec {$k} : ecriture " . reset($essai));
117
+        }
118
+
119
+        $trouver_table = charger_fonction('trouver_table', 'base');
120
+        $this->assertNotEmpty($GLOBALS['toto'], "La table spip_toto n'a pas ete cree !");
121
+        $this->assertNotEmpty($trouver_table('spip_toto'), "La table spip_toto n'a pas ete cree !");
122
+    }
123
+
124
+    /**
125
+     * re lire_config meta
126
+     */
127
+    #[Depends('testEcrireConfig')]
128
+    public function testLireConfig2() {
129
+        $essais = [];
130
+        $essais[] = [0, '/toto/test_cfg_zero'];
131
+        $essais[] = ['0', '/toto/test_cfg_zeroc'];
132
+        $essais[] = ['une chaine', '/toto/test_cfg_chaine'];
133
+        $essais[] = [self::$assoc, '/toto/test_cfg_assoc'];
134
+        $essais[] = [self::$serassoc, '/toto/test_cfg_serie', '', 0];
135
+
136
+        foreach ($essais as $k => $essai) {
137
+            $expected = array_shift($essai);
138
+            $this->assertEquals($expected, lire_config(...$essai), "Echec {$k} : lecture " . reset($essai));
139
+        }
140
+    }
141
+
142
+    /**
143
+     * effacer_config meta
144
+     */
145
+    #[Depends('testLireConfig2')]
146
+    public function testEffacerConfig() {
147
+        $essais = [];
148
+        $essais[] = [true, '/toto/test_cfg_zero'];
149
+        $essais[] = [true, '/toto/test_cfg_zeroc'];
150
+        $essais[] = [true, '/toto/test_cfg_chaine'];
151
+        $essais[] = [true, '/toto/test_cfg_assoc'];
152
+        $essais[] = [true, '/toto/test_cfg_serie'];
153
+
154
+        foreach ($essais as $k => $essai) {
155
+            $expected = array_shift($essai);
156
+            $this->assertEquals($expected, effacer_config(...$essai), "Echec {$k} : effacer " . reset($essai));
157
+        }
158
+    }
159
+
160
+    /**
161
+     * re lire_config meta
162
+     */
163
+    #[Depends('testEffacerConfig')]
164
+    public function testLireConfig3() {
165
+        $essais = [];
166
+        $essais[] = [null, '/toto/test_cfg_zero'];
167
+        $essais[] = [null, '/toto/test_cfg_zeroc'];
168
+        $essais[] = [null, '/toto/test_cfg_chaine'];
169
+        $essais[] = [null, '/toto/test_cfg_assoc'];
170
+        $essais[] = [null, '/toto/test_cfg_serie'];
171
+
172
+        foreach ($essais as $k => $essai) {
173
+            $expected = array_shift($essai);
174
+            $this->assertEquals($expected, lire_config(...$essai), "Echec {$k} : lecture " . reset($essai));
175
+        }
176
+
177
+        $trouver_table = charger_fonction('trouver_table', 'base');
178
+        $this->assertArrayNotHasKey(
179
+            'toto',
180
+            $GLOBALS,
181
+            "La table spip_toto n'a pas ete supprimee par le dernier effacement de config !"
182
+        );
183
+        $this->assertEmpty(
184
+            $trouver_table('spip_toto'),
185
+            "La table spip_toto n'a pas ete supprimee par le dernier effacement de config !"
186
+        );
187
+    }
188 188
 }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 
78 78
 		foreach ($essais as $k => $essai) {
79 79
 			$expected = array_shift($essai);
80
-			$this->assertEquals($expected, lire_config(...$essai), "Echec {$k} : lecture " . reset($essai));
80
+			$this->assertEquals($expected, lire_config(...$essai), "Echec {$k} : lecture ".reset($essai));
81 81
 		}
82 82
 
83 83
 		$GLOBALS['meta'] = $meta;
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 
114 114
 		foreach ($essais as $k => $essai) {
115 115
 			$expected = array_shift($essai);
116
-			$this->assertEquals($expected, ecrire_config(...$essai), "Echec {$k} : ecriture " . reset($essai));
116
+			$this->assertEquals($expected, ecrire_config(...$essai), "Echec {$k} : ecriture ".reset($essai));
117 117
 		}
118 118
 
119 119
 		$trouver_table = charger_fonction('trouver_table', 'base');
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 
136 136
 		foreach ($essais as $k => $essai) {
137 137
 			$expected = array_shift($essai);
138
-			$this->assertEquals($expected, lire_config(...$essai), "Echec {$k} : lecture " . reset($essai));
138
+			$this->assertEquals($expected, lire_config(...$essai), "Echec {$k} : lecture ".reset($essai));
139 139
 		}
140 140
 	}
141 141
 
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 
154 154
 		foreach ($essais as $k => $essai) {
155 155
 			$expected = array_shift($essai);
156
-			$this->assertEquals($expected, effacer_config(...$essai), "Echec {$k} : effacer " . reset($essai));
156
+			$this->assertEquals($expected, effacer_config(...$essai), "Echec {$k} : effacer ".reset($essai));
157 157
 		}
158 158
 	}
159 159
 
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 
172 172
 		foreach ($essais as $k => $essai) {
173 173
 			$expected = array_shift($essai);
174
-			$this->assertEquals($expected, lire_config(...$essai), "Echec {$k} : lecture " . reset($essai));
174
+			$this->assertEquals($expected, lire_config(...$essai), "Echec {$k} : lecture ".reset($essai));
175 175
 		}
176 176
 
177 177
 		$trouver_table = charger_fonction('trouver_table', 'base');
Please login to merge, or discard this patch.
ecrire/tests/Config/DepotMetaPackTest.php 2 patches
Indentation   +171 added lines, -171 removed lines patch added patch discarded remove patch
@@ -19,86 +19,86 @@  discard block
 block discarded – undo
19 19
 
20 20
 class DepotMetaPackTest extends TestCase
21 21
 {
22
-	protected static $savedMeta;
23
-
24
-	// les bases de test
25
-	protected static $assoc;
26
-
27
-	protected static $serassoc;
28
-
29
-	public static function setUpBeforeClass(): void {
30
-		self::$savedMeta = $GLOBALS['meta'];
31
-		self::$assoc = [
32
-			'one' => 'element 1',
33
-			'two' => 'element 2',
34
-			'three' => [
35
-				'un' => 1,
36
-				'deux' => 2,
37
-				'troisc' => '3',
38
-			],
39
-		];
40
-		self::$serassoc = serialize(self::$assoc);
41
-	}
42
-
43
-	public static function tearDownAfterClass(): void {
44
-		$GLOBALS['meta'] = self::$savedMeta;
45
-	}
46
-
47
-	/**
48
-	 * lire_config meta
49
-	 */
50
-	public function testLireConfig1() {
51
-		include_spip('inc/config');
52
-		$meta = $GLOBALS['meta'];
53
-
54
-		// on flingue meta a juste nos donnees
55
-		$GLOBALS['meta'] = [
56
-			'zero' => serialize(0),
57
-			'zeroc' => serialize('0'),
58
-			'chaine' => serialize('une chaine'),
59
-			'assoc' => serialize(self::$assoc),
60
-			'serie' => serialize(self::$serassoc),
61
-		];
62
-
63
-		$essais = [];
64
-		$essais[] = [$GLOBALS['meta'], 'metapack::'];
65
-		$essais[] = [serialize($GLOBALS['meta']), 'metapack::', '', false];
66
-		// racine
67
-		$essais[] = [0, 'metapack::zero'];
68
-		$essais[] = ['0', 'metapack::zeroc'];
69
-		$essais[] = ['une chaine', 'metapack::chaine'];
70
-		$essais[] = [self::$assoc, 'metapack::assoc'];
71
-		$essais[] = [self::$serassoc, 'metapack::serie'];
72
-		$essais[] = [null, 'metapack::rien'];
73
-		$essais[] = ['defaut', 'metapack::rien', 'defaut'];
74
-		// chemins
75
-		$essais[] = [self::$assoc, 'metapack::assoc/'];
76
-		$essais[] = ['element 1', 'metapack::assoc/one'];
77
-		$essais[] = [[
78
-			'un' => 1,
79
-			'deux' => 2,
80
-			'troisc' => '3',
81
-		], 'metapack::assoc/three'];
82
-		$essais[] = [1, 'metapack::assoc/three/un'];
83
-		$essais[] = ['3', 'metapack::assoc/three/troisc'];
84
-		// racourcis
85
-		$essais[] = [self::$assoc, 'assoc/'];
86
-		$essais[] = ['element 1', 'assoc/one'];
87
-
88
-		foreach ($essais as $k => $essai) {
89
-			$expected = array_shift($essai);
90
-			$this->assertEquals($expected, lire_config(...$essai), "Echec {$k} : lecture " . reset($essai));
91
-		}
92
-
93
-		$GLOBALS['meta'] = $meta;
94
-	}
95
-
96
-	/**
97
-	 * ecrire_config meta
98
-	 */
99
-	#[Depends('testLireConfig1')]
100
-	public function testEcrireConfig() {
101
-		/*
22
+    protected static $savedMeta;
23
+
24
+    // les bases de test
25
+    protected static $assoc;
26
+
27
+    protected static $serassoc;
28
+
29
+    public static function setUpBeforeClass(): void {
30
+        self::$savedMeta = $GLOBALS['meta'];
31
+        self::$assoc = [
32
+            'one' => 'element 1',
33
+            'two' => 'element 2',
34
+            'three' => [
35
+                'un' => 1,
36
+                'deux' => 2,
37
+                'troisc' => '3',
38
+            ],
39
+        ];
40
+        self::$serassoc = serialize(self::$assoc);
41
+    }
42
+
43
+    public static function tearDownAfterClass(): void {
44
+        $GLOBALS['meta'] = self::$savedMeta;
45
+    }
46
+
47
+    /**
48
+     * lire_config meta
49
+     */
50
+    public function testLireConfig1() {
51
+        include_spip('inc/config');
52
+        $meta = $GLOBALS['meta'];
53
+
54
+        // on flingue meta a juste nos donnees
55
+        $GLOBALS['meta'] = [
56
+            'zero' => serialize(0),
57
+            'zeroc' => serialize('0'),
58
+            'chaine' => serialize('une chaine'),
59
+            'assoc' => serialize(self::$assoc),
60
+            'serie' => serialize(self::$serassoc),
61
+        ];
62
+
63
+        $essais = [];
64
+        $essais[] = [$GLOBALS['meta'], 'metapack::'];
65
+        $essais[] = [serialize($GLOBALS['meta']), 'metapack::', '', false];
66
+        // racine
67
+        $essais[] = [0, 'metapack::zero'];
68
+        $essais[] = ['0', 'metapack::zeroc'];
69
+        $essais[] = ['une chaine', 'metapack::chaine'];
70
+        $essais[] = [self::$assoc, 'metapack::assoc'];
71
+        $essais[] = [self::$serassoc, 'metapack::serie'];
72
+        $essais[] = [null, 'metapack::rien'];
73
+        $essais[] = ['defaut', 'metapack::rien', 'defaut'];
74
+        // chemins
75
+        $essais[] = [self::$assoc, 'metapack::assoc/'];
76
+        $essais[] = ['element 1', 'metapack::assoc/one'];
77
+        $essais[] = [[
78
+            'un' => 1,
79
+            'deux' => 2,
80
+            'troisc' => '3',
81
+        ], 'metapack::assoc/three'];
82
+        $essais[] = [1, 'metapack::assoc/three/un'];
83
+        $essais[] = ['3', 'metapack::assoc/three/troisc'];
84
+        // racourcis
85
+        $essais[] = [self::$assoc, 'assoc/'];
86
+        $essais[] = ['element 1', 'assoc/one'];
87
+
88
+        foreach ($essais as $k => $essai) {
89
+            $expected = array_shift($essai);
90
+            $this->assertEquals($expected, lire_config(...$essai), "Echec {$k} : lecture " . reset($essai));
91
+        }
92
+
93
+        $GLOBALS['meta'] = $meta;
94
+    }
95
+
96
+    /**
97
+     * ecrire_config meta
98
+     */
99
+    #[Depends('testLireConfig1')]
100
+    public function testEcrireConfig() {
101
+        /*
102 102
 		 * Notes sur l'ecriture :
103 103
 		 * - dans le tableau $GLOBALS['meta'], les valeurs transmises
104 104
 		 * conservent effectivement leur type
@@ -113,95 +113,95 @@  discard block
 block discarded – undo
113 113
 		 * tout ce qu'on lui donne (et peut donc restituer le type de donnee correctement).
114 114
 		 *
115 115
 		 */
116
-		$essais = [];
117
-		$essais[] = [true, 'metapack::test_cfg_zero', 0];
118
-		$essais[] = [true, 'metapack::test_cfg_zeroc', '0'];
119
-		$essais[] = [true, 'metapack::test_cfg_chaine', 'une chaine'];
120
-		$essais[] = [true, 'metapack::test_cfg_assoc', self::$assoc];
121
-		$essais[] = [true, 'metapack::test_cfg_serie', self::$serassoc];
122
-		// chemins
123
-		$essais[] = [true, 'metapack::test_cfg_chemin/casier', self::$assoc];
124
-		$essais[] = [true, 'metapack::test_cfg_chemin/casier/truc', 'trac'];
125
-
126
-		foreach ($essais as $k => $essai) {
127
-			$expected = array_shift($essai);
128
-			$this->assertEquals($expected, ecrire_config(...$essai), "Echec {$k} : ecriture " . reset($essai));
129
-		}
130
-	}
131
-
132
-	/**
133
-	 * re lire_config meta
134
-	 */
135
-	#[Depends('testEcrireConfig')]
136
-	public function testLireConfig2() {
137
-		$essais = [];
138
-		$essais[] = [0, 'metapack::test_cfg_zero'];
139
-		$essais[] = ['0', 'metapack::test_cfg_zeroc'];
140
-		$essais[] = ['une chaine', 'metapack::test_cfg_chaine'];
141
-		$essais[] = [self::$assoc, 'metapack::test_cfg_assoc'];
142
-		$essais[] = [self::$serassoc, 'metapack::test_cfg_serie'];
143
-		// chemins
144
-		$essais[] = [self::$assoc + [
145
-			'truc' => 'trac',
146
-		], 'metapack::test_cfg_chemin/casier'];
147
-		$essais[] = ['trac', 'metapack::test_cfg_chemin/casier/truc'];
148
-		$essais[] = [1, 'metapack::test_cfg_chemin/casier/three/un'];
149
-		// chemin pas la
150
-		$essais[] = [null, 'metapack::test_cfg_chemin/casier/three/huit'];
151
-
152
-		foreach ($essais as $k => $essai) {
153
-			$expected = array_shift($essai);
154
-			$this->assertEquals($expected, lire_config(...$essai), "Echec {$k} : lecture " . reset($essai));
155
-		}
156
-	}
157
-
158
-	/**
159
-	 * effacer_config meta
160
-	 */
161
-	#[Depends('testLireConfig2')]
162
-	public function testEffacerConfig() {
163
-		$essais = [];
164
-		$essais[] = [true, 'metapack::test_cfg_zero'];
165
-		$essais[] = [true, 'metapack::test_cfg_zeroc'];
166
-		$essais[] = [true, 'metapack::test_cfg_chaine'];
167
-		$essais[] = [true, 'metapack::test_cfg_assoc'];
168
-		$essais[] = [true, 'metapack::test_cfg_serie'];
169
-		// chemins
170
-		// on enleve finement tout test_cfg_chemin : il ne doit rien rester
171
-		$essais[] = [true, 'metapack::test_cfg_chemin/casier/three/huit']; // n'existe pas
172
-		$essais[] = [true, 'metapack::test_cfg_chemin/casier/three/troisc'];
173
-		$essais[] = [true, 'metapack::test_cfg_chemin/casier/three/deux'];
174
-		$essais[] = [true, 'metapack::test_cfg_chemin/casier/three/un']; // supprime three
175
-		$essais[] = [true, 'metapack::test_cfg_chemin/casier/one'];
176
-		$essais[] = [true, 'metapack::test_cfg_chemin/casier/two'];
177
-		$essais[] = [true, 'metapack::test_cfg_chemin/casier/truc']; // supprimer chemin/casier
178
-
179
-		// on essaye d'effacer une meta qui n'existe pas
180
-		$essais[] = [true, 'metapack::test_cfg_dummy/casier/truc'];
181
-
182
-		foreach ($essais as $k => $essai) {
183
-			$expected = array_shift($essai);
184
-			$this->assertEquals($expected, effacer_config(...$essai), "Echec {$k} : effacer " . reset($essai));
185
-		}
186
-	}
187
-
188
-	/**
189
-	 * re lire_config meta
190
-	 */
191
-	#[Depends('testEffacerConfig')]
192
-	public function testLireConfig3() {
193
-		$essais = [];
194
-		$essais[] = [null, 'metapack::test_cfg_zero'];
195
-		$essais[] = [null, 'metapack::test_cfg_zeroc'];
196
-		$essais[] = [null, 'metapack::test_cfg_chaine'];
197
-		$essais[] = [null, 'metapack::test_cfg_assoc'];
198
-		$essais[] = [null, 'metapack::test_cfg_serie'];
199
-		$essais[] = [null, 'metapack::test_cfg_chemin'];
200
-		$essais[] = [null, 'metapack::test_cfg_dummy'];
201
-
202
-		foreach ($essais as $k => $essai) {
203
-			$expected = array_shift($essai);
204
-			$this->assertEquals($expected, lire_config(...$essai), "Echec {$k} : lecture " . reset($essai));
205
-		}
206
-	}
116
+        $essais = [];
117
+        $essais[] = [true, 'metapack::test_cfg_zero', 0];
118
+        $essais[] = [true, 'metapack::test_cfg_zeroc', '0'];
119
+        $essais[] = [true, 'metapack::test_cfg_chaine', 'une chaine'];
120
+        $essais[] = [true, 'metapack::test_cfg_assoc', self::$assoc];
121
+        $essais[] = [true, 'metapack::test_cfg_serie', self::$serassoc];
122
+        // chemins
123
+        $essais[] = [true, 'metapack::test_cfg_chemin/casier', self::$assoc];
124
+        $essais[] = [true, 'metapack::test_cfg_chemin/casier/truc', 'trac'];
125
+
126
+        foreach ($essais as $k => $essai) {
127
+            $expected = array_shift($essai);
128
+            $this->assertEquals($expected, ecrire_config(...$essai), "Echec {$k} : ecriture " . reset($essai));
129
+        }
130
+    }
131
+
132
+    /**
133
+     * re lire_config meta
134
+     */
135
+    #[Depends('testEcrireConfig')]
136
+    public function testLireConfig2() {
137
+        $essais = [];
138
+        $essais[] = [0, 'metapack::test_cfg_zero'];
139
+        $essais[] = ['0', 'metapack::test_cfg_zeroc'];
140
+        $essais[] = ['une chaine', 'metapack::test_cfg_chaine'];
141
+        $essais[] = [self::$assoc, 'metapack::test_cfg_assoc'];
142
+        $essais[] = [self::$serassoc, 'metapack::test_cfg_serie'];
143
+        // chemins
144
+        $essais[] = [self::$assoc + [
145
+            'truc' => 'trac',
146
+        ], 'metapack::test_cfg_chemin/casier'];
147
+        $essais[] = ['trac', 'metapack::test_cfg_chemin/casier/truc'];
148
+        $essais[] = [1, 'metapack::test_cfg_chemin/casier/three/un'];
149
+        // chemin pas la
150
+        $essais[] = [null, 'metapack::test_cfg_chemin/casier/three/huit'];
151
+
152
+        foreach ($essais as $k => $essai) {
153
+            $expected = array_shift($essai);
154
+            $this->assertEquals($expected, lire_config(...$essai), "Echec {$k} : lecture " . reset($essai));
155
+        }
156
+    }
157
+
158
+    /**
159
+     * effacer_config meta
160
+     */
161
+    #[Depends('testLireConfig2')]
162
+    public function testEffacerConfig() {
163
+        $essais = [];
164
+        $essais[] = [true, 'metapack::test_cfg_zero'];
165
+        $essais[] = [true, 'metapack::test_cfg_zeroc'];
166
+        $essais[] = [true, 'metapack::test_cfg_chaine'];
167
+        $essais[] = [true, 'metapack::test_cfg_assoc'];
168
+        $essais[] = [true, 'metapack::test_cfg_serie'];
169
+        // chemins
170
+        // on enleve finement tout test_cfg_chemin : il ne doit rien rester
171
+        $essais[] = [true, 'metapack::test_cfg_chemin/casier/three/huit']; // n'existe pas
172
+        $essais[] = [true, 'metapack::test_cfg_chemin/casier/three/troisc'];
173
+        $essais[] = [true, 'metapack::test_cfg_chemin/casier/three/deux'];
174
+        $essais[] = [true, 'metapack::test_cfg_chemin/casier/three/un']; // supprime three
175
+        $essais[] = [true, 'metapack::test_cfg_chemin/casier/one'];
176
+        $essais[] = [true, 'metapack::test_cfg_chemin/casier/two'];
177
+        $essais[] = [true, 'metapack::test_cfg_chemin/casier/truc']; // supprimer chemin/casier
178
+
179
+        // on essaye d'effacer une meta qui n'existe pas
180
+        $essais[] = [true, 'metapack::test_cfg_dummy/casier/truc'];
181
+
182
+        foreach ($essais as $k => $essai) {
183
+            $expected = array_shift($essai);
184
+            $this->assertEquals($expected, effacer_config(...$essai), "Echec {$k} : effacer " . reset($essai));
185
+        }
186
+    }
187
+
188
+    /**
189
+     * re lire_config meta
190
+     */
191
+    #[Depends('testEffacerConfig')]
192
+    public function testLireConfig3() {
193
+        $essais = [];
194
+        $essais[] = [null, 'metapack::test_cfg_zero'];
195
+        $essais[] = [null, 'metapack::test_cfg_zeroc'];
196
+        $essais[] = [null, 'metapack::test_cfg_chaine'];
197
+        $essais[] = [null, 'metapack::test_cfg_assoc'];
198
+        $essais[] = [null, 'metapack::test_cfg_serie'];
199
+        $essais[] = [null, 'metapack::test_cfg_chemin'];
200
+        $essais[] = [null, 'metapack::test_cfg_dummy'];
201
+
202
+        foreach ($essais as $k => $essai) {
203
+            $expected = array_shift($essai);
204
+            $this->assertEquals($expected, lire_config(...$essai), "Echec {$k} : lecture " . reset($essai));
205
+        }
206
+    }
207 207
 }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 
88 88
 		foreach ($essais as $k => $essai) {
89 89
 			$expected = array_shift($essai);
90
-			$this->assertEquals($expected, lire_config(...$essai), "Echec {$k} : lecture " . reset($essai));
90
+			$this->assertEquals($expected, lire_config(...$essai), "Echec {$k} : lecture ".reset($essai));
91 91
 		}
92 92
 
93 93
 		$GLOBALS['meta'] = $meta;
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 
126 126
 		foreach ($essais as $k => $essai) {
127 127
 			$expected = array_shift($essai);
128
-			$this->assertEquals($expected, ecrire_config(...$essai), "Echec {$k} : ecriture " . reset($essai));
128
+			$this->assertEquals($expected, ecrire_config(...$essai), "Echec {$k} : ecriture ".reset($essai));
129 129
 		}
130 130
 	}
131 131
 
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 
152 152
 		foreach ($essais as $k => $essai) {
153 153
 			$expected = array_shift($essai);
154
-			$this->assertEquals($expected, lire_config(...$essai), "Echec {$k} : lecture " . reset($essai));
154
+			$this->assertEquals($expected, lire_config(...$essai), "Echec {$k} : lecture ".reset($essai));
155 155
 		}
156 156
 	}
157 157
 
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 
182 182
 		foreach ($essais as $k => $essai) {
183 183
 			$expected = array_shift($essai);
184
-			$this->assertEquals($expected, effacer_config(...$essai), "Echec {$k} : effacer " . reset($essai));
184
+			$this->assertEquals($expected, effacer_config(...$essai), "Echec {$k} : effacer ".reset($essai));
185 185
 		}
186 186
 	}
187 187
 
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 
202 202
 		foreach ($essais as $k => $essai) {
203 203
 			$expected = array_shift($essai);
204
-			$this->assertEquals($expected, lire_config(...$essai), "Echec {$k} : lecture " . reset($essai));
204
+			$this->assertEquals($expected, lire_config(...$essai), "Echec {$k} : lecture ".reset($essai));
205 205
 		}
206 206
 	}
207 207
 }
Please login to merge, or discard this patch.
ecrire/tests/Config/DepotMetaTest.php 2 patches
Indentation   +157 added lines, -157 removed lines patch added patch discarded remove patch
@@ -19,95 +19,95 @@  discard block
 block discarded – undo
19 19
 
20 20
 class DepotMetaTest extends TestCase
21 21
 {
22
-	protected static $savedMeta;
23
-
24
-	// les bases de test
25
-	protected static $assoc;
26
-
27
-	protected static $serassoc;
28
-
29
-	public static function setUpBeforeClass(): void {
30
-		self::$savedMeta = $GLOBALS['meta'];
31
-		self::$assoc = [
32
-			'one' => 'element 1',
33
-			'two' => 'element 2',
34
-		];
35
-		self::$serassoc = serialize(self::$assoc);
36
-		include_spip('inc/config');
37
-	}
38
-
39
-	public static function tearDownAfterClass(): void {
40
-		$GLOBALS['meta'] = self::$savedMeta;
41
-	}
42
-
43
-	/**
44
-	 * expliquer_config
45
-	 */
46
-	public function testExpliquerConfig() {
47
-		$essais = [];
48
-		$essais[] = [['meta', null, []], ''];
49
-		$essais[] = [['meta', '0', []], '0'];
50
-		$essais[] = [['meta', 'casier', []], 'casier'];
51
-		$essais[] = [['meta', 'casier', ['sous']], 'casier/sous'];
52
-		$essais[] = [['meta', 'casier', ['sous', 'plus', 'bas', 'encore']], 'casier/sous/plus/bas/encore'];
53
-
54
-		$essais[] = [['meta', null, []], '/meta'];
55
-		$essais[] = [['meta', 'casier', []], '/meta/casier'];
56
-		$essais[] = [['meta', 'casier', ['sous']], '/meta/casier/sous'];
57
-		$essais[] = [['meta', 'casier', ['sous', 'plus', 'bas', 'encore']], '/meta/casier/sous/plus/bas/encore'];
58
-
59
-		$essais[] = [['toto', null, []], '/toto'];
60
-		$essais[] = [['toto', 'casier', []], '/toto/casier'];
61
-		$essais[] = [['toto', 'casier', ['sous']], '/toto/casier/sous'];
62
-		$essais[] = [['toto', 'casier', ['sous', 'plus', 'bas', 'encore']], '/toto/casier/sous/plus/bas/encore'];
63
-
64
-		foreach ($essais as $k => $essai) {
65
-			$expected = array_shift($essai);
66
-			$this->assertEquals($expected, expliquer_config(...$essai), "Echec {$k} : lecture " . end($essai));
67
-		}
68
-	}
69
-
70
-	/**
71
-	 * lire_config meta
72
-	 */
73
-	#[Depends('testExpliquerConfig')]
74
-	public function testLireConfig1() {
75
-		$meta = $GLOBALS['meta'];
76
-
77
-		// on flingue meta a juste nos donnees
78
-		$GLOBALS['meta'] = [
79
-			'zero' => 0,
80
-			'zeroc' => '0',
81
-			'chaine' => 'une chaine',
82
-			'assoc' => self::$assoc,
83
-			'serie' => self::$serassoc,
84
-		];
85
-
86
-		$essais = [];
87
-		$essais[] = [$GLOBALS['meta'], ''];
88
-		$essais[] = [0, 'zero'];
89
-		$essais[] = ['0', 'zeroc'];
90
-		$essais[] = ['une chaine', 'chaine'];
91
-		$essais[] = [self::$assoc, 'assoc'];
92
-		$essais[] = [self::$assoc, 'serie'];
93
-		$essais[] = [self::$serassoc, 'serie', '', 0];
94
-		$essais[] = [null, 'rien'];
95
-		$essais[] = ['defaut', 'rien', 'defaut'];
96
-
97
-		foreach ($essais as $k => $essai) {
98
-			$expected = array_shift($essai);
99
-			$this->assertEquals($expected, lire_config(...$essai), "Echec {$k} : lecture " . reset($essai));
100
-		}
101
-
102
-		$GLOBALS['meta'] = $meta;
103
-	}
104
-
105
-	/**
106
-	 * ecrire_config meta
107
-	 */
108
-	#[Depends('testLireConfig1')]
109
-	public function testEcrireConfig() {
110
-		/*
22
+    protected static $savedMeta;
23
+
24
+    // les bases de test
25
+    protected static $assoc;
26
+
27
+    protected static $serassoc;
28
+
29
+    public static function setUpBeforeClass(): void {
30
+        self::$savedMeta = $GLOBALS['meta'];
31
+        self::$assoc = [
32
+            'one' => 'element 1',
33
+            'two' => 'element 2',
34
+        ];
35
+        self::$serassoc = serialize(self::$assoc);
36
+        include_spip('inc/config');
37
+    }
38
+
39
+    public static function tearDownAfterClass(): void {
40
+        $GLOBALS['meta'] = self::$savedMeta;
41
+    }
42
+
43
+    /**
44
+     * expliquer_config
45
+     */
46
+    public function testExpliquerConfig() {
47
+        $essais = [];
48
+        $essais[] = [['meta', null, []], ''];
49
+        $essais[] = [['meta', '0', []], '0'];
50
+        $essais[] = [['meta', 'casier', []], 'casier'];
51
+        $essais[] = [['meta', 'casier', ['sous']], 'casier/sous'];
52
+        $essais[] = [['meta', 'casier', ['sous', 'plus', 'bas', 'encore']], 'casier/sous/plus/bas/encore'];
53
+
54
+        $essais[] = [['meta', null, []], '/meta'];
55
+        $essais[] = [['meta', 'casier', []], '/meta/casier'];
56
+        $essais[] = [['meta', 'casier', ['sous']], '/meta/casier/sous'];
57
+        $essais[] = [['meta', 'casier', ['sous', 'plus', 'bas', 'encore']], '/meta/casier/sous/plus/bas/encore'];
58
+
59
+        $essais[] = [['toto', null, []], '/toto'];
60
+        $essais[] = [['toto', 'casier', []], '/toto/casier'];
61
+        $essais[] = [['toto', 'casier', ['sous']], '/toto/casier/sous'];
62
+        $essais[] = [['toto', 'casier', ['sous', 'plus', 'bas', 'encore']], '/toto/casier/sous/plus/bas/encore'];
63
+
64
+        foreach ($essais as $k => $essai) {
65
+            $expected = array_shift($essai);
66
+            $this->assertEquals($expected, expliquer_config(...$essai), "Echec {$k} : lecture " . end($essai));
67
+        }
68
+    }
69
+
70
+    /**
71
+     * lire_config meta
72
+     */
73
+    #[Depends('testExpliquerConfig')]
74
+    public function testLireConfig1() {
75
+        $meta = $GLOBALS['meta'];
76
+
77
+        // on flingue meta a juste nos donnees
78
+        $GLOBALS['meta'] = [
79
+            'zero' => 0,
80
+            'zeroc' => '0',
81
+            'chaine' => 'une chaine',
82
+            'assoc' => self::$assoc,
83
+            'serie' => self::$serassoc,
84
+        ];
85
+
86
+        $essais = [];
87
+        $essais[] = [$GLOBALS['meta'], ''];
88
+        $essais[] = [0, 'zero'];
89
+        $essais[] = ['0', 'zeroc'];
90
+        $essais[] = ['une chaine', 'chaine'];
91
+        $essais[] = [self::$assoc, 'assoc'];
92
+        $essais[] = [self::$assoc, 'serie'];
93
+        $essais[] = [self::$serassoc, 'serie', '', 0];
94
+        $essais[] = [null, 'rien'];
95
+        $essais[] = ['defaut', 'rien', 'defaut'];
96
+
97
+        foreach ($essais as $k => $essai) {
98
+            $expected = array_shift($essai);
99
+            $this->assertEquals($expected, lire_config(...$essai), "Echec {$k} : lecture " . reset($essai));
100
+        }
101
+
102
+        $GLOBALS['meta'] = $meta;
103
+    }
104
+
105
+    /**
106
+     * ecrire_config meta
107
+     */
108
+    #[Depends('testLireConfig1')]
109
+    public function testEcrireConfig() {
110
+        /*
111 111
 		 * Notes sur l'ecriture :
112 112
 		 * - dans le tableau $GLOBALS['meta'], les valeurs transmises
113 113
 		 * conservent effectivement leur type
@@ -122,72 +122,72 @@  discard block
 block discarded – undo
122 122
 		 * tout ce qu'on lui donne (et peut donc restituer le type de donnee correctement).
123 123
 		 *
124 124
 		 */
125
-		$essais = [];
126
-		$essais[] = [true, 'test_cfg_zero', 0];
127
-		$essais[] = [true, 'test_cfg_zeroc', '0'];
128
-		$essais[] = [true, 'test_cfg_chaine', 'une chaine'];
129
-		$essais[] = [true, 'test_cfg_assoc', self::$assoc];
130
-		$essais[] = [true, 'test_cfg_serie', self::$serassoc];
131
-
132
-		foreach ($essais as $k => $essai) {
133
-			$expected = array_shift($essai);
134
-			$this->assertEquals($expected, ecrire_config(...$essai), "Echec {$k} : ecriture " . reset($essai));
135
-		}
136
-	}
137
-
138
-	/**
139
-	 * re lire_config meta
140
-	 */
141
-	#[Depends('testEcrireConfig')]
142
-	public function testLireConfig2() {
143
-		$essais = [];
144
-		$essais[] = [0, 'test_cfg_zero'];
145
-		$essais[] = ['0', 'test_cfg_zeroc'];
146
-		$essais[] = ['une chaine', 'test_cfg_chaine'];
147
-		$essais[] = [self::$assoc, 'test_cfg_assoc'];
148
-		$essais[] = [self::$serassoc, 'test_cfg_serie', '', 0];
149
-
150
-		foreach ($essais as $k => $essai) {
151
-			$expected = array_shift($essai);
152
-			$this->assertEquals($expected, lire_config(...$essai), "Echec {$k} : lecture " . reset($essai));
153
-		}
154
-	}
155
-
156
-	/**
157
-	 * effacer_config meta
158
-	 */
159
-	#[Depends('testLireConfig2')]
160
-	public function testEffacerConfig() {
161
-		$essais = [];
162
-		$essais[] = [true, 'test_cfg_zero'];
163
-		$essais[] = [true, 'test_cfg_zeroc'];
164
-		$essais[] = [true, 'test_cfg_chaine'];
165
-		$essais[] = [true, 'test_cfg_assoc'];
166
-		$essais[] = [true, 'test_cfg_serie'];
167
-		$essais[] = [true, 'test_cfg_dummy'];
168
-
169
-		foreach ($essais as $k => $essai) {
170
-			$expected = array_shift($essai);
171
-			$this->assertEquals($expected, effacer_config(...$essai), "Echec {$k} : effacer " . reset($essai));
172
-		}
173
-	}
174
-
175
-	/**
176
-	 * re lire_config meta
177
-	 */
178
-	#[Depends('testEffacerConfig')]
179
-	public function testLireConfig3() {
180
-		$essais = [];
181
-		$essais[] = [null, 'test_cfg_zero'];
182
-		$essais[] = [null, 'test_cfg_zeroc'];
183
-		$essais[] = [null, 'test_cfg_chaine'];
184
-		$essais[] = [null, 'test_cfg_assoc'];
185
-		$essais[] = [null, 'test_cfg_serie'];
186
-		$essais[] = [null, 'test_cfg_dummy'];
187
-
188
-		foreach ($essais as $k => $essai) {
189
-			$expected = array_shift($essai);
190
-			$this->assertEquals($expected, lire_config(...$essai), "Echec {$k} : lecture " . reset($essai));
191
-		}
192
-	}
125
+        $essais = [];
126
+        $essais[] = [true, 'test_cfg_zero', 0];
127
+        $essais[] = [true, 'test_cfg_zeroc', '0'];
128
+        $essais[] = [true, 'test_cfg_chaine', 'une chaine'];
129
+        $essais[] = [true, 'test_cfg_assoc', self::$assoc];
130
+        $essais[] = [true, 'test_cfg_serie', self::$serassoc];
131
+
132
+        foreach ($essais as $k => $essai) {
133
+            $expected = array_shift($essai);
134
+            $this->assertEquals($expected, ecrire_config(...$essai), "Echec {$k} : ecriture " . reset($essai));
135
+        }
136
+    }
137
+
138
+    /**
139
+     * re lire_config meta
140
+     */
141
+    #[Depends('testEcrireConfig')]
142
+    public function testLireConfig2() {
143
+        $essais = [];
144
+        $essais[] = [0, 'test_cfg_zero'];
145
+        $essais[] = ['0', 'test_cfg_zeroc'];
146
+        $essais[] = ['une chaine', 'test_cfg_chaine'];
147
+        $essais[] = [self::$assoc, 'test_cfg_assoc'];
148
+        $essais[] = [self::$serassoc, 'test_cfg_serie', '', 0];
149
+
150
+        foreach ($essais as $k => $essai) {
151
+            $expected = array_shift($essai);
152
+            $this->assertEquals($expected, lire_config(...$essai), "Echec {$k} : lecture " . reset($essai));
153
+        }
154
+    }
155
+
156
+    /**
157
+     * effacer_config meta
158
+     */
159
+    #[Depends('testLireConfig2')]
160
+    public function testEffacerConfig() {
161
+        $essais = [];
162
+        $essais[] = [true, 'test_cfg_zero'];
163
+        $essais[] = [true, 'test_cfg_zeroc'];
164
+        $essais[] = [true, 'test_cfg_chaine'];
165
+        $essais[] = [true, 'test_cfg_assoc'];
166
+        $essais[] = [true, 'test_cfg_serie'];
167
+        $essais[] = [true, 'test_cfg_dummy'];
168
+
169
+        foreach ($essais as $k => $essai) {
170
+            $expected = array_shift($essai);
171
+            $this->assertEquals($expected, effacer_config(...$essai), "Echec {$k} : effacer " . reset($essai));
172
+        }
173
+    }
174
+
175
+    /**
176
+     * re lire_config meta
177
+     */
178
+    #[Depends('testEffacerConfig')]
179
+    public function testLireConfig3() {
180
+        $essais = [];
181
+        $essais[] = [null, 'test_cfg_zero'];
182
+        $essais[] = [null, 'test_cfg_zeroc'];
183
+        $essais[] = [null, 'test_cfg_chaine'];
184
+        $essais[] = [null, 'test_cfg_assoc'];
185
+        $essais[] = [null, 'test_cfg_serie'];
186
+        $essais[] = [null, 'test_cfg_dummy'];
187
+
188
+        foreach ($essais as $k => $essai) {
189
+            $expected = array_shift($essai);
190
+            $this->assertEquals($expected, lire_config(...$essai), "Echec {$k} : lecture " . reset($essai));
191
+        }
192
+    }
193 193
 }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 
64 64
 		foreach ($essais as $k => $essai) {
65 65
 			$expected = array_shift($essai);
66
-			$this->assertEquals($expected, expliquer_config(...$essai), "Echec {$k} : lecture " . end($essai));
66
+			$this->assertEquals($expected, expliquer_config(...$essai), "Echec {$k} : lecture ".end($essai));
67 67
 		}
68 68
 	}
69 69
 
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 
97 97
 		foreach ($essais as $k => $essai) {
98 98
 			$expected = array_shift($essai);
99
-			$this->assertEquals($expected, lire_config(...$essai), "Echec {$k} : lecture " . reset($essai));
99
+			$this->assertEquals($expected, lire_config(...$essai), "Echec {$k} : lecture ".reset($essai));
100 100
 		}
101 101
 
102 102
 		$GLOBALS['meta'] = $meta;
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 
132 132
 		foreach ($essais as $k => $essai) {
133 133
 			$expected = array_shift($essai);
134
-			$this->assertEquals($expected, ecrire_config(...$essai), "Echec {$k} : ecriture " . reset($essai));
134
+			$this->assertEquals($expected, ecrire_config(...$essai), "Echec {$k} : ecriture ".reset($essai));
135 135
 		}
136 136
 	}
137 137
 
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 
150 150
 		foreach ($essais as $k => $essai) {
151 151
 			$expected = array_shift($essai);
152
-			$this->assertEquals($expected, lire_config(...$essai), "Echec {$k} : lecture " . reset($essai));
152
+			$this->assertEquals($expected, lire_config(...$essai), "Echec {$k} : lecture ".reset($essai));
153 153
 		}
154 154
 	}
155 155
 
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 
169 169
 		foreach ($essais as $k => $essai) {
170 170
 			$expected = array_shift($essai);
171
-			$this->assertEquals($expected, effacer_config(...$essai), "Echec {$k} : effacer " . reset($essai));
171
+			$this->assertEquals($expected, effacer_config(...$essai), "Echec {$k} : effacer ".reset($essai));
172 172
 		}
173 173
 	}
174 174
 
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 
188 188
 		foreach ($essais as $k => $essai) {
189 189
 			$expected = array_shift($essai);
190
-			$this->assertEquals($expected, lire_config(...$essai), "Echec {$k} : lecture " . reset($essai));
190
+			$this->assertEquals($expected, lire_config(...$essai), "Echec {$k} : lecture ".reset($essai));
191 191
 		}
192 192
 	}
193 193
 }
Please login to merge, or discard this patch.
ecrire/tests/Template.php 2 patches
Indentation   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -8,76 +8,76 @@
 block discarded – undo
8 8
 
9 9
 class Template
10 10
 {
11
-	public function __construct(
12
-		private readonly string $fond
13
-	) {
14
-	}
11
+    public function __construct(
12
+        private readonly string $fond
13
+    ) {
14
+    }
15 15
 
16
-	public function render(array $contexte = [], string $connect = ''): string {
17
-		$infos = $this->rawRender($contexte, $connect);
18
-		if (!empty($infos['erreurs'])) {
19
-			$message = json_encode($infos['erreurs'], \JSON_UNESCAPED_UNICODE | \JSON_PRETTY_PRINT);
20
-			if (!$message) {
21
-				$erreurs = $infos['erreurs'];
22
-				foreach ($erreurs as &$erreur) {
23
-					$erreur = reset($erreur);
24
-				}
25
-				$message = json_encode($erreurs, \JSON_UNESCAPED_UNICODE | \JSON_PRETTY_PRINT);
26
-			}
27
-			throw new TemplateCompilationErrorException($message);
28
-		}
29
-		return $infos['texte'];
30
-	}
16
+    public function render(array $contexte = [], string $connect = ''): string {
17
+        $infos = $this->rawRender($contexte, $connect);
18
+        if (!empty($infos['erreurs'])) {
19
+            $message = json_encode($infos['erreurs'], \JSON_UNESCAPED_UNICODE | \JSON_PRETTY_PRINT);
20
+            if (!$message) {
21
+                $erreurs = $infos['erreurs'];
22
+                foreach ($erreurs as &$erreur) {
23
+                    $erreur = reset($erreur);
24
+                }
25
+                $message = json_encode($erreurs, \JSON_UNESCAPED_UNICODE | \JSON_PRETTY_PRINT);
26
+            }
27
+            throw new TemplateCompilationErrorException($message);
28
+        }
29
+        return $infos['texte'];
30
+    }
31 31
 
32
-	/**
33
-	 * Appele recuperer_fond avec l'option raw pour obtenir un tableau d'informations que l'on complete avec le nom du fond
34
-	 * et les erreurs de compilations generees
35
-	 */
36
-	public function rawRender(array $contexte = [], string $connect = ''): array {
37
-		// vider les erreurs
38
-		$this->init_compilation_errors();
32
+    /**
33
+     * Appele recuperer_fond avec l'option raw pour obtenir un tableau d'informations que l'on complete avec le nom du fond
34
+     * et les erreurs de compilations generees
35
+     */
36
+    public function rawRender(array $contexte = [], string $connect = ''): array {
37
+        // vider les erreurs
38
+        $this->init_compilation_errors();
39 39
 
40
-		// en mode 'raw' ça ne trim pas le texte, sacrebleu !
41
-		$infos = recuperer_fond($this->fond, $contexte, [
42
-			'raw' => true,
43
-			'trim' => true,
44
-		], $connect);
45
-		$infos['texte'] = trim($infos['texte']);
40
+        // en mode 'raw' ça ne trim pas le texte, sacrebleu !
41
+        $infos = recuperer_fond($this->fond, $contexte, [
42
+            'raw' => true,
43
+            'trim' => true,
44
+        ], $connect);
45
+        $infos['texte'] = trim($infos['texte']);
46 46
 
47
-		if (!empty($infos['source'])) {
48
-			// on ajoute des infos supplementaires a celles retournees
49
-			$path = pathinfo($infos['source']);
50
-			$infos['fond'] = $path['dirname'] . '/' . $path['filename']; // = $fond;
51
-			$infos['erreurs'] = $this->get_compilation_errors();
52
-		} else {
53
-			// on a été interrompu par un minipres ?
54
-			throw new \Exception('Calcul de ' . $this->fond . ' interrompue (minipres?)' . "\n\n" . $infos['texte']);
55
-		}
47
+        if (!empty($infos['source'])) {
48
+            // on ajoute des infos supplementaires a celles retournees
49
+            $path = pathinfo($infos['source']);
50
+            $infos['fond'] = $path['dirname'] . '/' . $path['filename']; // = $fond;
51
+            $infos['erreurs'] = $this->get_compilation_errors();
52
+        } else {
53
+            // on a été interrompu par un minipres ?
54
+            throw new \Exception('Calcul de ' . $this->fond . ' interrompue (minipres?)' . "\n\n" . $infos['texte']);
55
+        }
56 56
 
57
-		return $infos;
58
-	}
57
+        return $infos;
58
+    }
59 59
 
60
-	/**
61
-	 * Retourne un tableau des erreurs de compilation
62
-	 */
63
-	private function get_compilation_errors(): array {
64
-		$debusquer = charger_fonction('debusquer', 'public');
65
-		$erreurs = $debusquer('', '', [
66
-			'erreurs' => 'get',
67
-		]);
68
-		$debusquer('', '', [
69
-			'erreurs' => 'reset',
70
-		]);
71
-		return $erreurs;
72
-	}
60
+    /**
61
+     * Retourne un tableau des erreurs de compilation
62
+     */
63
+    private function get_compilation_errors(): array {
64
+        $debusquer = charger_fonction('debusquer', 'public');
65
+        $erreurs = $debusquer('', '', [
66
+            'erreurs' => 'get',
67
+        ]);
68
+        $debusquer('', '', [
69
+            'erreurs' => 'reset',
70
+        ]);
71
+        return $erreurs;
72
+    }
73 73
 
74
-	/**
75
-	 * Raz les erreurs de compilation
76
-	 */
77
-	private function init_compilation_errors(): void {
78
-		$debusquer = charger_fonction('debusquer', 'public');
79
-		$debusquer('', '', [
80
-			'erreurs' => 'reset',
81
-		]);
82
-	}
74
+    /**
75
+     * Raz les erreurs de compilation
76
+     */
77
+    private function init_compilation_errors(): void {
78
+        $debusquer = charger_fonction('debusquer', 'public');
79
+        $debusquer('', '', [
80
+            'erreurs' => 'reset',
81
+        ]);
82
+    }
83 83
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -47,11 +47,11 @@
 block discarded – undo
47 47
 		if (!empty($infos['source'])) {
48 48
 			// on ajoute des infos supplementaires a celles retournees
49 49
 			$path = pathinfo($infos['source']);
50
-			$infos['fond'] = $path['dirname'] . '/' . $path['filename']; // = $fond;
50
+			$infos['fond'] = $path['dirname'].'/'.$path['filename']; // = $fond;
51 51
 			$infos['erreurs'] = $this->get_compilation_errors();
52 52
 		} else {
53 53
 			// on a été interrompu par un minipres ?
54
-			throw new \Exception('Calcul de ' . $this->fond . ' interrompue (minipres?)' . "\n\n" . $infos['texte']);
54
+			throw new \Exception('Calcul de '.$this->fond.' interrompue (minipres?)'."\n\n".$infos['texte']);
55 55
 		}
56 56
 
57 57
 		return $infos;
Please login to merge, or discard this patch.
ecrire/tests/Plugin/DirPluginsSupplTest.php 2 patches
Indentation   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -10,56 +10,56 @@
 block discarded – undo
10 10
 
11 11
 class DirPluginsSupplTest extends TestCase
12 12
 {
13
-	const DIR_PLUGINS_SUPPL = _DIR_TMP . 'test_dir_plugins_suppl/';
14
-	const DIR_PLUGINS_OUTSIDE = _DIR_TMP . 'test_dir_plugins_outisde/';
15
-	const PAQUET_TEST = 'toto/paquet.xml';
13
+    const DIR_PLUGINS_SUPPL = _DIR_TMP . 'test_dir_plugins_suppl/';
14
+    const DIR_PLUGINS_OUTSIDE = _DIR_TMP . 'test_dir_plugins_outisde/';
15
+    const PAQUET_TEST = 'toto/paquet.xml';
16 16
 
17
-	public static function setUpBeforeClass(): void {
18
-		find_in_path('./inc/plugin.php', '', true);
19
-		supprimer_repertoire(self::DIR_PLUGINS_SUPPL);
20
-		mkdir(self::DIR_PLUGINS_SUPPL . 'toto', 0777, true);
21
-		mkdir(self::DIR_PLUGINS_OUTSIDE . 'toto', 0777, true);
22
-		copy(__DIR__ . '/data/paquet.xml', self::DIR_PLUGINS_SUPPL . self::PAQUET_TEST);
23
-		copy(__DIR__ . '/data/paquet.xml', self::DIR_PLUGINS_OUTSIDE . self::PAQUET_TEST);
24
-	}
17
+    public static function setUpBeforeClass(): void {
18
+        find_in_path('./inc/plugin.php', '', true);
19
+        supprimer_repertoire(self::DIR_PLUGINS_SUPPL);
20
+        mkdir(self::DIR_PLUGINS_SUPPL . 'toto', 0777, true);
21
+        mkdir(self::DIR_PLUGINS_OUTSIDE . 'toto', 0777, true);
22
+        copy(__DIR__ . '/data/paquet.xml', self::DIR_PLUGINS_SUPPL . self::PAQUET_TEST);
23
+        copy(__DIR__ . '/data/paquet.xml', self::DIR_PLUGINS_OUTSIDE . self::PAQUET_TEST);
24
+    }
25 25
 
26
-	public static function tearDownAfterClass(): void {
27
-		supprimer_repertoire(self::DIR_PLUGINS_SUPPL);
28
-		supprimer_repertoire(self::DIR_PLUGINS_OUTSIDE);
29
-	}
26
+    public static function tearDownAfterClass(): void {
27
+        supprimer_repertoire(self::DIR_PLUGINS_SUPPL);
28
+        supprimer_repertoire(self::DIR_PLUGINS_OUTSIDE);
29
+    }
30 30
 
31
-	public function testConstant() {
32
-		// preparation: la constante est elle definie et comprend uniquement 1 reps suppl?
33
-		if (defined('_DIR_PLUGINS_SUPPL') && _DIR_PLUGINS_SUPPL !== self::DIR_PLUGINS_SUPPL) {
34
-			$this->markTestSkipped(sprintf('La constante _DIR_PLUGINS_SUPPL est déjà définie, le test ne peut s’appliquer. Valeur "%s"', _DIR_PLUGINS_SUPPL));
35
-		}
36
-		define('_DIR_PLUGINS_SUPPL', self::DIR_PLUGINS_SUPPL);
37
-		if (substr_count(_DIR_PLUGINS_SUPPL, ':') !== 0) {
38
-			$this->markTestSkipped(sprintf('La constante _DIR_PLUGINS_SUPPL ne doit contenir qu’un seul chemin supplémentaire. Valeur: "%s"', _DIR_PLUGINS_SUPPL));
39
-		}
40
-		if (!str_ends_with(_DIR_PLUGINS_SUPPL, '/')) {
41
-			$this->markTestSkipped(sprintf('La constante _DIR_PLUGINS_SUPPL doit terminer par un /. Valeur: "%s"', _DIR_PLUGINS_SUPPL));
42
-		}
43
-		$this->assertTrue(true);
44
-	}
31
+    public function testConstant() {
32
+        // preparation: la constante est elle definie et comprend uniquement 1 reps suppl?
33
+        if (defined('_DIR_PLUGINS_SUPPL') && _DIR_PLUGINS_SUPPL !== self::DIR_PLUGINS_SUPPL) {
34
+            $this->markTestSkipped(sprintf('La constante _DIR_PLUGINS_SUPPL est déjà définie, le test ne peut s’appliquer. Valeur "%s"', _DIR_PLUGINS_SUPPL));
35
+        }
36
+        define('_DIR_PLUGINS_SUPPL', self::DIR_PLUGINS_SUPPL);
37
+        if (substr_count(_DIR_PLUGINS_SUPPL, ':') !== 0) {
38
+            $this->markTestSkipped(sprintf('La constante _DIR_PLUGINS_SUPPL ne doit contenir qu’un seul chemin supplémentaire. Valeur: "%s"', _DIR_PLUGINS_SUPPL));
39
+        }
40
+        if (!str_ends_with(_DIR_PLUGINS_SUPPL, '/')) {
41
+            $this->markTestSkipped(sprintf('La constante _DIR_PLUGINS_SUPPL doit terminer par un /. Valeur: "%s"', _DIR_PLUGINS_SUPPL));
42
+        }
43
+        $this->assertTrue(true);
44
+    }
45 45
 
46
-	#[Depends('testConstant')]
47
-	public function testDirectory() {
48
-		// le rep suppl existe
49
-		$this->assertTrue(is_dir(self::DIR_PLUGINS_SUPPL), sprintf('Le répertoire "%s" aurait du être créé', self::DIR_PLUGINS_SUPPL));
50
-		$this->assertTrue(file_exists(self::DIR_PLUGINS_SUPPL . self::PAQUET_TEST), sprintf('Le fichier "%s" aurait du être créé', self::DIR_PLUGINS_SUPPL . self::PAQUET_TEST));
51
-		// le rep outside existe
52
-		$this->assertTrue(is_dir(self::DIR_PLUGINS_OUTSIDE), sprintf('Le répertoire "%s" aurait du être créé', self::DIR_PLUGINS_OUTSIDE));
53
-		$this->assertTrue(file_exists(self::DIR_PLUGINS_OUTSIDE . self::PAQUET_TEST), sprintf('Le fichier "%s" aurait du être créé', self::DIR_PLUGINS_OUTSIDE . self::PAQUET_TEST));
54
-	}
46
+    #[Depends('testConstant')]
47
+    public function testDirectory() {
48
+        // le rep suppl existe
49
+        $this->assertTrue(is_dir(self::DIR_PLUGINS_SUPPL), sprintf('Le répertoire "%s" aurait du être créé', self::DIR_PLUGINS_SUPPL));
50
+        $this->assertTrue(file_exists(self::DIR_PLUGINS_SUPPL . self::PAQUET_TEST), sprintf('Le fichier "%s" aurait du être créé', self::DIR_PLUGINS_SUPPL . self::PAQUET_TEST));
51
+        // le rep outside existe
52
+        $this->assertTrue(is_dir(self::DIR_PLUGINS_OUTSIDE), sprintf('Le répertoire "%s" aurait du être créé', self::DIR_PLUGINS_OUTSIDE));
53
+        $this->assertTrue(file_exists(self::DIR_PLUGINS_OUTSIDE . self::PAQUET_TEST), sprintf('Le fichier "%s" aurait du être créé', self::DIR_PLUGINS_OUTSIDE . self::PAQUET_TEST));
54
+    }
55 55
 
56
-	#[Depends('testDirectory')]
57
-	public function testListePluginsSuppl() {
58
-		$plugins = liste_plugin_files(self::DIR_PLUGINS_SUPPL);
59
-		// verifier qu'on retrouve bien tous les rep suppl de _DIR_PLUGINS_SUPPL
60
-		$this->assertContains('toto', $plugins, sprintf('Le répertoire "%s" non trouvé dans "%s"', 'toto', self::DIR_PLUGINS_SUPPL));
61
-		// Mais pas des plugins en trop !
62
-		$this->assertCount(1, $plugins, sprintf('Il y a plus qu’un plugin trouvé dans "%s"', self::DIR_PLUGINS_SUPPL));
63
-	}
56
+    #[Depends('testDirectory')]
57
+    public function testListePluginsSuppl() {
58
+        $plugins = liste_plugin_files(self::DIR_PLUGINS_SUPPL);
59
+        // verifier qu'on retrouve bien tous les rep suppl de _DIR_PLUGINS_SUPPL
60
+        $this->assertContains('toto', $plugins, sprintf('Le répertoire "%s" non trouvé dans "%s"', 'toto', self::DIR_PLUGINS_SUPPL));
61
+        // Mais pas des plugins en trop !
62
+        $this->assertCount(1, $plugins, sprintf('Il y a plus qu’un plugin trouvé dans "%s"', self::DIR_PLUGINS_SUPPL));
63
+    }
64 64
 
65 65
 }
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -10,17 +10,17 @@  discard block
 block discarded – undo
10 10
 
11 11
 class DirPluginsSupplTest extends TestCase
12 12
 {
13
-	const DIR_PLUGINS_SUPPL = _DIR_TMP . 'test_dir_plugins_suppl/';
14
-	const DIR_PLUGINS_OUTSIDE = _DIR_TMP . 'test_dir_plugins_outisde/';
13
+	const DIR_PLUGINS_SUPPL = _DIR_TMP.'test_dir_plugins_suppl/';
14
+	const DIR_PLUGINS_OUTSIDE = _DIR_TMP.'test_dir_plugins_outisde/';
15 15
 	const PAQUET_TEST = 'toto/paquet.xml';
16 16
 
17 17
 	public static function setUpBeforeClass(): void {
18 18
 		find_in_path('./inc/plugin.php', '', true);
19 19
 		supprimer_repertoire(self::DIR_PLUGINS_SUPPL);
20
-		mkdir(self::DIR_PLUGINS_SUPPL . 'toto', 0777, true);
21
-		mkdir(self::DIR_PLUGINS_OUTSIDE . 'toto', 0777, true);
22
-		copy(__DIR__ . '/data/paquet.xml', self::DIR_PLUGINS_SUPPL . self::PAQUET_TEST);
23
-		copy(__DIR__ . '/data/paquet.xml', self::DIR_PLUGINS_OUTSIDE . self::PAQUET_TEST);
20
+		mkdir(self::DIR_PLUGINS_SUPPL.'toto', 0777, true);
21
+		mkdir(self::DIR_PLUGINS_OUTSIDE.'toto', 0777, true);
22
+		copy(__DIR__.'/data/paquet.xml', self::DIR_PLUGINS_SUPPL.self::PAQUET_TEST);
23
+		copy(__DIR__.'/data/paquet.xml', self::DIR_PLUGINS_OUTSIDE.self::PAQUET_TEST);
24 24
 	}
25 25
 
26 26
 	public static function tearDownAfterClass(): void {
@@ -47,10 +47,10 @@  discard block
 block discarded – undo
47 47
 	public function testDirectory() {
48 48
 		// le rep suppl existe
49 49
 		$this->assertTrue(is_dir(self::DIR_PLUGINS_SUPPL), sprintf('Le répertoire "%s" aurait du être créé', self::DIR_PLUGINS_SUPPL));
50
-		$this->assertTrue(file_exists(self::DIR_PLUGINS_SUPPL . self::PAQUET_TEST), sprintf('Le fichier "%s" aurait du être créé', self::DIR_PLUGINS_SUPPL . self::PAQUET_TEST));
50
+		$this->assertTrue(file_exists(self::DIR_PLUGINS_SUPPL.self::PAQUET_TEST), sprintf('Le fichier "%s" aurait du être créé', self::DIR_PLUGINS_SUPPL.self::PAQUET_TEST));
51 51
 		// le rep outside existe
52 52
 		$this->assertTrue(is_dir(self::DIR_PLUGINS_OUTSIDE), sprintf('Le répertoire "%s" aurait du être créé', self::DIR_PLUGINS_OUTSIDE));
53
-		$this->assertTrue(file_exists(self::DIR_PLUGINS_OUTSIDE . self::PAQUET_TEST), sprintf('Le fichier "%s" aurait du être créé', self::DIR_PLUGINS_OUTSIDE . self::PAQUET_TEST));
53
+		$this->assertTrue(file_exists(self::DIR_PLUGINS_OUTSIDE.self::PAQUET_TEST), sprintf('Le fichier "%s" aurait du être créé', self::DIR_PLUGINS_OUTSIDE.self::PAQUET_TEST));
54 54
 	}
55 55
 
56 56
 	#[Depends('testDirectory')]
Please login to merge, or discard this patch.
ecrire/tests/Plugin/SpipVersionCompareTest.php 1 patch
Indentation   +546 added lines, -546 removed lines patch added patch discarded remove patch
@@ -13,552 +13,552 @@
 block discarded – undo
13 13
 
14 14
 class SpipVersionCompareTest extends TestCase
15 15
 {
16
-	public static function setUpBeforeClass(): void {
17
-		find_in_path('./inc/plugin.php', '', true);
18
-	}
16
+    public static function setUpBeforeClass(): void {
17
+        find_in_path('./inc/plugin.php', '', true);
18
+    }
19 19
 
20
-	#[DataProvider('providerPluginSpipVersionCompare')]
21
-	public function testPluginSpipVersionCompare($expected, ...$args): void {
22
-		$actual = spip_version_compare(...$args);
23
-		$this->assertSame($expected, $actual);
24
-	}
20
+    #[DataProvider('providerPluginSpipVersionCompare')]
21
+    public function testPluginSpipVersionCompare($expected, ...$args): void {
22
+        $actual = spip_version_compare(...$args);
23
+        $this->assertSame($expected, $actual);
24
+    }
25 25
 
26
-	public static function providerPluginSpipVersionCompare(): array {
27
-		return [
28
-			0 => [
29
-				0 => false,
30
-				1 => '2',
31
-				2 => '2',
32
-				3 => '>',
33
-			],
34
-			1 => [
35
-				0 => false,
36
-				1 => '2',
37
-				2 => '2.0',
38
-				3 => '>',
39
-			],
40
-			2 => [
41
-				0 => false,
42
-				1 => '2',
43
-				2 => '2.0.0',
44
-				3 => '>',
45
-			],
46
-			3 => [
47
-				0 => true,
48
-				1 => '2',
49
-				2 => '2.0.0dev',
50
-				3 => '>',
51
-			],
52
-			4 => [
53
-				0 => true,
54
-				1 => '2',
55
-				2 => '2.0.0alpha',
56
-				3 => '>',
57
-			],
58
-			5 => [
59
-				0 => true,
60
-				1 => '2',
61
-				2 => '2.0.0beta',
62
-				3 => '>',
63
-			],
64
-			6 => [
65
-				0 => true,
66
-				1 => '2',
67
-				2 => '2.0.0rc',
68
-				3 => '>',
69
-			],
70
-			8 => [
71
-				0 => false,
72
-				1 => '2',
73
-				2 => '2.0.0pl',
74
-				3 => '>',
75
-			],
76
-			9 => [
77
-				0 => false,
78
-				1 => '2',
79
-				2 => '2.0.1',
80
-				3 => '>',
81
-			],
82
-			10 => [
83
-				0 => false,
84
-				1 => '2.0',
85
-				2 => '2',
86
-				3 => '>',
87
-			],
88
-			11 => [
89
-				0 => false,
90
-				1 => '2.0',
91
-				2 => '2.0',
92
-				3 => '>',
93
-			],
94
-			12 => [
95
-				0 => false,
96
-				1 => '2.0',
97
-				2 => '2.0.0',
98
-				3 => '>',
99
-			],
100
-			13 => [
101
-				0 => true,
102
-				1 => '2.0',
103
-				2 => '2.0.0dev',
104
-				3 => '>',
105
-			],
106
-			14 => [
107
-				0 => true,
108
-				1 => '2.0',
109
-				2 => '2.0.0alpha',
110
-				3 => '>',
111
-			],
112
-			15 => [
113
-				0 => true,
114
-				1 => '2.0',
115
-				2 => '2.0.0beta',
116
-				3 => '>',
117
-			],
118
-			16 => [
119
-				0 => true,
120
-				1 => '2.0',
121
-				2 => '2.0.0rc',
122
-				3 => '>',
123
-			],
124
-			18 => [
125
-				0 => false,
126
-				1 => '2.0',
127
-				2 => '2.0.0pl',
128
-				3 => '>',
129
-			],
130
-			19 => [
131
-				0 => false,
132
-				1 => '2.0',
133
-				2 => '2.0.1',
134
-				3 => '>',
135
-			],
136
-			20 => [
137
-				0 => false,
138
-				1 => '2.0.0',
139
-				2 => '2',
140
-				3 => '>',
141
-			],
142
-			21 => [
143
-				0 => false,
144
-				1 => '2.0.0',
145
-				2 => '2.0',
146
-				3 => '>',
147
-			],
148
-			22 => [
149
-				0 => false,
150
-				1 => '2.0.0',
151
-				2 => '2.0.0',
152
-				3 => '>',
153
-			],
154
-			23 => [
155
-				0 => true,
156
-				1 => '2.0.0',
157
-				2 => '2.0.0dev',
158
-				3 => '>',
159
-			],
160
-			24 => [
161
-				0 => true,
162
-				1 => '2.0.0',
163
-				2 => '2.0.0alpha',
164
-				3 => '>',
165
-			],
166
-			25 => [
167
-				0 => true,
168
-				1 => '2.0.0',
169
-				2 => '2.0.0beta',
170
-				3 => '>',
171
-			],
172
-			26 => [
173
-				0 => true,
174
-				1 => '2.0.0',
175
-				2 => '2.0.0rc',
176
-				3 => '>',
177
-			],
178
-			28 => [
179
-				0 => false,
180
-				1 => '2.0.0',
181
-				2 => '2.0.0pl',
182
-				3 => '>',
183
-			],
184
-			29 => [
185
-				0 => false,
186
-				1 => '2.0.0',
187
-				2 => '2.0.1',
188
-				3 => '>',
189
-			],
190
-			30 => [
191
-				0 => false,
192
-				1 => '2.0.0dev',
193
-				2 => '2',
194
-				3 => '>',
195
-			],
196
-			31 => [
197
-				0 => false,
198
-				1 => '2.0.0dev',
199
-				2 => '2.0',
200
-				3 => '>',
201
-			],
202
-			32 => [
203
-				0 => false,
204
-				1 => '2.0.0dev',
205
-				2 => '2.0.0',
206
-				3 => '>',
207
-			],
208
-			33 => [
209
-				0 => false,
210
-				1 => '2.0.0dev',
211
-				2 => '2.0.0dev',
212
-				3 => '>',
213
-			],
214
-			34 => [
215
-				0 => false,
216
-				1 => '2.0.0dev',
217
-				2 => '2.0.0alpha',
218
-				3 => '>',
219
-			],
220
-			35 => [
221
-				0 => false,
222
-				1 => '2.0.0dev',
223
-				2 => '2.0.0beta',
224
-				3 => '>',
225
-			],
226
-			36 => [
227
-				0 => false,
228
-				1 => '2.0.0dev',
229
-				2 => '2.0.0rc',
230
-				3 => '>',
231
-			],
232
-			38 => [
233
-				0 => false,
234
-				1 => '2.0.0dev',
235
-				2 => '2.0.0pl',
236
-				3 => '>',
237
-			],
238
-			39 => [
239
-				0 => false,
240
-				1 => '2.0.0dev',
241
-				2 => '2.0.1',
242
-				3 => '>',
243
-			],
244
-			40 => [
245
-				0 => false,
246
-				1 => '2.0.0alpha',
247
-				2 => '2',
248
-				3 => '>',
249
-			],
250
-			41 => [
251
-				0 => false,
252
-				1 => '2.0.0alpha',
253
-				2 => '2.0',
254
-				3 => '>',
255
-			],
256
-			42 => [
257
-				0 => false,
258
-				1 => '2.0.0alpha',
259
-				2 => '2.0.0',
260
-				3 => '>',
261
-			],
262
-			43 => [
263
-				0 => true,
264
-				1 => '2.0.0alpha',
265
-				2 => '2.0.0dev',
266
-				3 => '>',
267
-			],
268
-			44 => [
269
-				0 => false,
270
-				1 => '2.0.0alpha',
271
-				2 => '2.0.0alpha',
272
-				3 => '>',
273
-			],
274
-			45 => [
275
-				0 => false,
276
-				1 => '2.0.0alpha',
277
-				2 => '2.0.0beta',
278
-				3 => '>',
279
-			],
280
-			46 => [
281
-				0 => false,
282
-				1 => '2.0.0alpha',
283
-				2 => '2.0.0rc',
284
-				3 => '>',
285
-			],
286
-			48 => [
287
-				0 => false,
288
-				1 => '2.0.0alpha',
289
-				2 => '2.0.0pl',
290
-				3 => '>',
291
-			],
292
-			49 => [
293
-				0 => false,
294
-				1 => '2.0.0alpha',
295
-				2 => '2.0.1',
296
-				3 => '>',
297
-			],
298
-			50 => [
299
-				0 => false,
300
-				1 => '2.0.0beta',
301
-				2 => '2',
302
-				3 => '>',
303
-			],
304
-			51 => [
305
-				0 => false,
306
-				1 => '2.0.0beta',
307
-				2 => '2.0',
308
-				3 => '>',
309
-			],
310
-			52 => [
311
-				0 => false,
312
-				1 => '2.0.0beta',
313
-				2 => '2.0.0',
314
-				3 => '>',
315
-			],
316
-			53 => [
317
-				0 => true,
318
-				1 => '2.0.0beta',
319
-				2 => '2.0.0dev',
320
-				3 => '>',
321
-			],
322
-			54 => [
323
-				0 => true,
324
-				1 => '2.0.0beta',
325
-				2 => '2.0.0alpha',
326
-				3 => '>',
327
-			],
328
-			55 => [
329
-				0 => false,
330
-				1 => '2.0.0beta',
331
-				2 => '2.0.0beta',
332
-				3 => '>',
333
-			],
334
-			56 => [
335
-				0 => false,
336
-				1 => '2.0.0beta',
337
-				2 => '2.0.0rc',
338
-				3 => '>',
339
-			],
340
-			58 => [
341
-				0 => false,
342
-				1 => '2.0.0beta',
343
-				2 => '2.0.0pl',
344
-				3 => '>',
345
-			],
346
-			59 => [
347
-				0 => false,
348
-				1 => '2.0.0beta',
349
-				2 => '2.0.1',
350
-				3 => '>',
351
-			],
352
-			60 => [
353
-				0 => false,
354
-				1 => '2.0.0rc',
355
-				2 => '2',
356
-				3 => '>',
357
-			],
358
-			61 => [
359
-				0 => false,
360
-				1 => '2.0.0rc',
361
-				2 => '2.0',
362
-				3 => '>',
363
-			],
364
-			62 => [
365
-				0 => false,
366
-				1 => '2.0.0rc',
367
-				2 => '2.0.0',
368
-				3 => '>',
369
-			],
370
-			63 => [
371
-				0 => true,
372
-				1 => '2.0.0rc',
373
-				2 => '2.0.0dev',
374
-				3 => '>',
375
-			],
376
-			64 => [
377
-				0 => true,
378
-				1 => '2.0.0rc',
379
-				2 => '2.0.0alpha',
380
-				3 => '>',
381
-			],
382
-			65 => [
383
-				0 => true,
384
-				1 => '2.0.0rc',
385
-				2 => '2.0.0beta',
386
-				3 => '>',
387
-			],
388
-			66 => [
389
-				0 => false,
390
-				1 => '2.0.0rc',
391
-				2 => '2.0.0rc',
392
-				3 => '>',
393
-			],
394
-			68 => [
395
-				0 => false,
396
-				1 => '2.0.0rc',
397
-				2 => '2.0.0pl',
398
-				3 => '>',
399
-			],
400
-			69 => [
401
-				0 => false,
402
-				1 => '2.0.0rc',
403
-				2 => '2.0.1',
404
-				3 => '>',
405
-			],
406
-			80 => [
407
-				0 => true,
408
-				1 => '2.0.0pl',
409
-				2 => '2',
410
-				3 => '>',
411
-			],
412
-			81 => [
413
-				0 => true,
414
-				1 => '2.0.0pl',
415
-				2 => '2.0',
416
-				3 => '>',
417
-			],
418
-			82 => [
419
-				0 => true,
420
-				1 => '2.0.0pl',
421
-				2 => '2.0.0',
422
-				3 => '>',
423
-			],
424
-			83 => [
425
-				0 => true,
426
-				1 => '2.0.0pl',
427
-				2 => '2.0.0dev',
428
-				3 => '>',
429
-			],
430
-			84 => [
431
-				0 => true,
432
-				1 => '2.0.0pl',
433
-				2 => '2.0.0alpha',
434
-				3 => '>',
435
-			],
436
-			85 => [
437
-				0 => true,
438
-				1 => '2.0.0pl',
439
-				2 => '2.0.0beta',
440
-				3 => '>',
441
-			],
442
-			86 => [
443
-				0 => true,
444
-				1 => '2.0.0pl',
445
-				2 => '2.0.0rc',
446
-				3 => '>',
447
-			],
448
-			88 => [
449
-				0 => false,
450
-				1 => '2.0.0pl',
451
-				2 => '2.0.0pl',
452
-				3 => '>',
453
-			],
454
-			89 => [
455
-				0 => false,
456
-				1 => '2.0.0pl',
457
-				2 => '2.0.1',
458
-				3 => '>',
459
-			],
460
-			90 => [
461
-				0 => true,
462
-				1 => '2.0.1',
463
-				2 => '2',
464
-				3 => '>',
465
-			],
466
-			91 => [
467
-				0 => true,
468
-				1 => '2.0.1',
469
-				2 => '2.0',
470
-				3 => '>',
471
-			],
472
-			92 => [
473
-				0 => true,
474
-				1 => '2.0.1',
475
-				2 => '2.0.0',
476
-				3 => '>',
477
-			],
478
-			93 => [
479
-				0 => true,
480
-				1 => '2.0.1',
481
-				2 => '2.0.0dev',
482
-				3 => '>',
483
-			],
484
-			94 => [
485
-				0 => true,
486
-				1 => '2.0.1',
487
-				2 => '2.0.0alpha',
488
-				3 => '>',
489
-			],
490
-			95 => [
491
-				0 => true,
492
-				1 => '2.0.1',
493
-				2 => '2.0.0beta',
494
-				3 => '>',
495
-			],
496
-			96 => [
497
-				0 => true,
498
-				1 => '2.0.1',
499
-				2 => '2.0.0rc',
500
-				3 => '>',
501
-			],
502
-			98 => [
503
-				0 => true,
504
-				1 => '2.0.1',
505
-				2 => '2.0.0pl',
506
-				3 => '>',
507
-			],
508
-			99 => [
509
-				0 => false,
510
-				1 => '2.0.1',
511
-				2 => '2.0.1',
512
-				3 => '>',
513
-			],
514
-			100 => [
515
-				0 => true,
516
-				1 => '2',
517
-				2 => '2.0',
518
-				3 => '=',
519
-			],
520
-			101 => [
521
-				0 => true,
522
-				1 => '2.0',
523
-				2 => '2.0.0',
524
-				3 => '=',
525
-			],
526
-			102 => [
527
-				0 => true,
528
-				1 => '2.0.0alpha',
529
-				2 => '2.0.0 alpha',
530
-				3 => '=',
531
-			],
532
-			103 => [
533
-				0 => true,
534
-				1 => '2.0.0alpha',
535
-				2 => '2.0.0-alpha',
536
-				3 => '=',
537
-			],
538
-			104 => [
539
-				0 => true,
540
-				1 => '2.0.0alpha',
541
-				2 => '2.0.0a',
542
-				3 => '=',
543
-			],
544
-			105 => [
545
-				0 => true,
546
-				1 => '2.0.0beta',
547
-				2 => '2.0.0b',
548
-				3 => '=',
549
-			],
550
-			106 => [
551
-				0 => true,
552
-				1 => '2.0.0pl',
553
-				2 => '2.0.0p',
554
-				3 => '=',
555
-			],
556
-			107 => [
557
-				0 => true,
558
-				1 => '2.0.0-rc',
559
-				2 => '2.0.0RC',
560
-				3 => '=',
561
-			],
562
-		];
563
-	}
26
+    public static function providerPluginSpipVersionCompare(): array {
27
+        return [
28
+            0 => [
29
+                0 => false,
30
+                1 => '2',
31
+                2 => '2',
32
+                3 => '>',
33
+            ],
34
+            1 => [
35
+                0 => false,
36
+                1 => '2',
37
+                2 => '2.0',
38
+                3 => '>',
39
+            ],
40
+            2 => [
41
+                0 => false,
42
+                1 => '2',
43
+                2 => '2.0.0',
44
+                3 => '>',
45
+            ],
46
+            3 => [
47
+                0 => true,
48
+                1 => '2',
49
+                2 => '2.0.0dev',
50
+                3 => '>',
51
+            ],
52
+            4 => [
53
+                0 => true,
54
+                1 => '2',
55
+                2 => '2.0.0alpha',
56
+                3 => '>',
57
+            ],
58
+            5 => [
59
+                0 => true,
60
+                1 => '2',
61
+                2 => '2.0.0beta',
62
+                3 => '>',
63
+            ],
64
+            6 => [
65
+                0 => true,
66
+                1 => '2',
67
+                2 => '2.0.0rc',
68
+                3 => '>',
69
+            ],
70
+            8 => [
71
+                0 => false,
72
+                1 => '2',
73
+                2 => '2.0.0pl',
74
+                3 => '>',
75
+            ],
76
+            9 => [
77
+                0 => false,
78
+                1 => '2',
79
+                2 => '2.0.1',
80
+                3 => '>',
81
+            ],
82
+            10 => [
83
+                0 => false,
84
+                1 => '2.0',
85
+                2 => '2',
86
+                3 => '>',
87
+            ],
88
+            11 => [
89
+                0 => false,
90
+                1 => '2.0',
91
+                2 => '2.0',
92
+                3 => '>',
93
+            ],
94
+            12 => [
95
+                0 => false,
96
+                1 => '2.0',
97
+                2 => '2.0.0',
98
+                3 => '>',
99
+            ],
100
+            13 => [
101
+                0 => true,
102
+                1 => '2.0',
103
+                2 => '2.0.0dev',
104
+                3 => '>',
105
+            ],
106
+            14 => [
107
+                0 => true,
108
+                1 => '2.0',
109
+                2 => '2.0.0alpha',
110
+                3 => '>',
111
+            ],
112
+            15 => [
113
+                0 => true,
114
+                1 => '2.0',
115
+                2 => '2.0.0beta',
116
+                3 => '>',
117
+            ],
118
+            16 => [
119
+                0 => true,
120
+                1 => '2.0',
121
+                2 => '2.0.0rc',
122
+                3 => '>',
123
+            ],
124
+            18 => [
125
+                0 => false,
126
+                1 => '2.0',
127
+                2 => '2.0.0pl',
128
+                3 => '>',
129
+            ],
130
+            19 => [
131
+                0 => false,
132
+                1 => '2.0',
133
+                2 => '2.0.1',
134
+                3 => '>',
135
+            ],
136
+            20 => [
137
+                0 => false,
138
+                1 => '2.0.0',
139
+                2 => '2',
140
+                3 => '>',
141
+            ],
142
+            21 => [
143
+                0 => false,
144
+                1 => '2.0.0',
145
+                2 => '2.0',
146
+                3 => '>',
147
+            ],
148
+            22 => [
149
+                0 => false,
150
+                1 => '2.0.0',
151
+                2 => '2.0.0',
152
+                3 => '>',
153
+            ],
154
+            23 => [
155
+                0 => true,
156
+                1 => '2.0.0',
157
+                2 => '2.0.0dev',
158
+                3 => '>',
159
+            ],
160
+            24 => [
161
+                0 => true,
162
+                1 => '2.0.0',
163
+                2 => '2.0.0alpha',
164
+                3 => '>',
165
+            ],
166
+            25 => [
167
+                0 => true,
168
+                1 => '2.0.0',
169
+                2 => '2.0.0beta',
170
+                3 => '>',
171
+            ],
172
+            26 => [
173
+                0 => true,
174
+                1 => '2.0.0',
175
+                2 => '2.0.0rc',
176
+                3 => '>',
177
+            ],
178
+            28 => [
179
+                0 => false,
180
+                1 => '2.0.0',
181
+                2 => '2.0.0pl',
182
+                3 => '>',
183
+            ],
184
+            29 => [
185
+                0 => false,
186
+                1 => '2.0.0',
187
+                2 => '2.0.1',
188
+                3 => '>',
189
+            ],
190
+            30 => [
191
+                0 => false,
192
+                1 => '2.0.0dev',
193
+                2 => '2',
194
+                3 => '>',
195
+            ],
196
+            31 => [
197
+                0 => false,
198
+                1 => '2.0.0dev',
199
+                2 => '2.0',
200
+                3 => '>',
201
+            ],
202
+            32 => [
203
+                0 => false,
204
+                1 => '2.0.0dev',
205
+                2 => '2.0.0',
206
+                3 => '>',
207
+            ],
208
+            33 => [
209
+                0 => false,
210
+                1 => '2.0.0dev',
211
+                2 => '2.0.0dev',
212
+                3 => '>',
213
+            ],
214
+            34 => [
215
+                0 => false,
216
+                1 => '2.0.0dev',
217
+                2 => '2.0.0alpha',
218
+                3 => '>',
219
+            ],
220
+            35 => [
221
+                0 => false,
222
+                1 => '2.0.0dev',
223
+                2 => '2.0.0beta',
224
+                3 => '>',
225
+            ],
226
+            36 => [
227
+                0 => false,
228
+                1 => '2.0.0dev',
229
+                2 => '2.0.0rc',
230
+                3 => '>',
231
+            ],
232
+            38 => [
233
+                0 => false,
234
+                1 => '2.0.0dev',
235
+                2 => '2.0.0pl',
236
+                3 => '>',
237
+            ],
238
+            39 => [
239
+                0 => false,
240
+                1 => '2.0.0dev',
241
+                2 => '2.0.1',
242
+                3 => '>',
243
+            ],
244
+            40 => [
245
+                0 => false,
246
+                1 => '2.0.0alpha',
247
+                2 => '2',
248
+                3 => '>',
249
+            ],
250
+            41 => [
251
+                0 => false,
252
+                1 => '2.0.0alpha',
253
+                2 => '2.0',
254
+                3 => '>',
255
+            ],
256
+            42 => [
257
+                0 => false,
258
+                1 => '2.0.0alpha',
259
+                2 => '2.0.0',
260
+                3 => '>',
261
+            ],
262
+            43 => [
263
+                0 => true,
264
+                1 => '2.0.0alpha',
265
+                2 => '2.0.0dev',
266
+                3 => '>',
267
+            ],
268
+            44 => [
269
+                0 => false,
270
+                1 => '2.0.0alpha',
271
+                2 => '2.0.0alpha',
272
+                3 => '>',
273
+            ],
274
+            45 => [
275
+                0 => false,
276
+                1 => '2.0.0alpha',
277
+                2 => '2.0.0beta',
278
+                3 => '>',
279
+            ],
280
+            46 => [
281
+                0 => false,
282
+                1 => '2.0.0alpha',
283
+                2 => '2.0.0rc',
284
+                3 => '>',
285
+            ],
286
+            48 => [
287
+                0 => false,
288
+                1 => '2.0.0alpha',
289
+                2 => '2.0.0pl',
290
+                3 => '>',
291
+            ],
292
+            49 => [
293
+                0 => false,
294
+                1 => '2.0.0alpha',
295
+                2 => '2.0.1',
296
+                3 => '>',
297
+            ],
298
+            50 => [
299
+                0 => false,
300
+                1 => '2.0.0beta',
301
+                2 => '2',
302
+                3 => '>',
303
+            ],
304
+            51 => [
305
+                0 => false,
306
+                1 => '2.0.0beta',
307
+                2 => '2.0',
308
+                3 => '>',
309
+            ],
310
+            52 => [
311
+                0 => false,
312
+                1 => '2.0.0beta',
313
+                2 => '2.0.0',
314
+                3 => '>',
315
+            ],
316
+            53 => [
317
+                0 => true,
318
+                1 => '2.0.0beta',
319
+                2 => '2.0.0dev',
320
+                3 => '>',
321
+            ],
322
+            54 => [
323
+                0 => true,
324
+                1 => '2.0.0beta',
325
+                2 => '2.0.0alpha',
326
+                3 => '>',
327
+            ],
328
+            55 => [
329
+                0 => false,
330
+                1 => '2.0.0beta',
331
+                2 => '2.0.0beta',
332
+                3 => '>',
333
+            ],
334
+            56 => [
335
+                0 => false,
336
+                1 => '2.0.0beta',
337
+                2 => '2.0.0rc',
338
+                3 => '>',
339
+            ],
340
+            58 => [
341
+                0 => false,
342
+                1 => '2.0.0beta',
343
+                2 => '2.0.0pl',
344
+                3 => '>',
345
+            ],
346
+            59 => [
347
+                0 => false,
348
+                1 => '2.0.0beta',
349
+                2 => '2.0.1',
350
+                3 => '>',
351
+            ],
352
+            60 => [
353
+                0 => false,
354
+                1 => '2.0.0rc',
355
+                2 => '2',
356
+                3 => '>',
357
+            ],
358
+            61 => [
359
+                0 => false,
360
+                1 => '2.0.0rc',
361
+                2 => '2.0',
362
+                3 => '>',
363
+            ],
364
+            62 => [
365
+                0 => false,
366
+                1 => '2.0.0rc',
367
+                2 => '2.0.0',
368
+                3 => '>',
369
+            ],
370
+            63 => [
371
+                0 => true,
372
+                1 => '2.0.0rc',
373
+                2 => '2.0.0dev',
374
+                3 => '>',
375
+            ],
376
+            64 => [
377
+                0 => true,
378
+                1 => '2.0.0rc',
379
+                2 => '2.0.0alpha',
380
+                3 => '>',
381
+            ],
382
+            65 => [
383
+                0 => true,
384
+                1 => '2.0.0rc',
385
+                2 => '2.0.0beta',
386
+                3 => '>',
387
+            ],
388
+            66 => [
389
+                0 => false,
390
+                1 => '2.0.0rc',
391
+                2 => '2.0.0rc',
392
+                3 => '>',
393
+            ],
394
+            68 => [
395
+                0 => false,
396
+                1 => '2.0.0rc',
397
+                2 => '2.0.0pl',
398
+                3 => '>',
399
+            ],
400
+            69 => [
401
+                0 => false,
402
+                1 => '2.0.0rc',
403
+                2 => '2.0.1',
404
+                3 => '>',
405
+            ],
406
+            80 => [
407
+                0 => true,
408
+                1 => '2.0.0pl',
409
+                2 => '2',
410
+                3 => '>',
411
+            ],
412
+            81 => [
413
+                0 => true,
414
+                1 => '2.0.0pl',
415
+                2 => '2.0',
416
+                3 => '>',
417
+            ],
418
+            82 => [
419
+                0 => true,
420
+                1 => '2.0.0pl',
421
+                2 => '2.0.0',
422
+                3 => '>',
423
+            ],
424
+            83 => [
425
+                0 => true,
426
+                1 => '2.0.0pl',
427
+                2 => '2.0.0dev',
428
+                3 => '>',
429
+            ],
430
+            84 => [
431
+                0 => true,
432
+                1 => '2.0.0pl',
433
+                2 => '2.0.0alpha',
434
+                3 => '>',
435
+            ],
436
+            85 => [
437
+                0 => true,
438
+                1 => '2.0.0pl',
439
+                2 => '2.0.0beta',
440
+                3 => '>',
441
+            ],
442
+            86 => [
443
+                0 => true,
444
+                1 => '2.0.0pl',
445
+                2 => '2.0.0rc',
446
+                3 => '>',
447
+            ],
448
+            88 => [
449
+                0 => false,
450
+                1 => '2.0.0pl',
451
+                2 => '2.0.0pl',
452
+                3 => '>',
453
+            ],
454
+            89 => [
455
+                0 => false,
456
+                1 => '2.0.0pl',
457
+                2 => '2.0.1',
458
+                3 => '>',
459
+            ],
460
+            90 => [
461
+                0 => true,
462
+                1 => '2.0.1',
463
+                2 => '2',
464
+                3 => '>',
465
+            ],
466
+            91 => [
467
+                0 => true,
468
+                1 => '2.0.1',
469
+                2 => '2.0',
470
+                3 => '>',
471
+            ],
472
+            92 => [
473
+                0 => true,
474
+                1 => '2.0.1',
475
+                2 => '2.0.0',
476
+                3 => '>',
477
+            ],
478
+            93 => [
479
+                0 => true,
480
+                1 => '2.0.1',
481
+                2 => '2.0.0dev',
482
+                3 => '>',
483
+            ],
484
+            94 => [
485
+                0 => true,
486
+                1 => '2.0.1',
487
+                2 => '2.0.0alpha',
488
+                3 => '>',
489
+            ],
490
+            95 => [
491
+                0 => true,
492
+                1 => '2.0.1',
493
+                2 => '2.0.0beta',
494
+                3 => '>',
495
+            ],
496
+            96 => [
497
+                0 => true,
498
+                1 => '2.0.1',
499
+                2 => '2.0.0rc',
500
+                3 => '>',
501
+            ],
502
+            98 => [
503
+                0 => true,
504
+                1 => '2.0.1',
505
+                2 => '2.0.0pl',
506
+                3 => '>',
507
+            ],
508
+            99 => [
509
+                0 => false,
510
+                1 => '2.0.1',
511
+                2 => '2.0.1',
512
+                3 => '>',
513
+            ],
514
+            100 => [
515
+                0 => true,
516
+                1 => '2',
517
+                2 => '2.0',
518
+                3 => '=',
519
+            ],
520
+            101 => [
521
+                0 => true,
522
+                1 => '2.0',
523
+                2 => '2.0.0',
524
+                3 => '=',
525
+            ],
526
+            102 => [
527
+                0 => true,
528
+                1 => '2.0.0alpha',
529
+                2 => '2.0.0 alpha',
530
+                3 => '=',
531
+            ],
532
+            103 => [
533
+                0 => true,
534
+                1 => '2.0.0alpha',
535
+                2 => '2.0.0-alpha',
536
+                3 => '=',
537
+            ],
538
+            104 => [
539
+                0 => true,
540
+                1 => '2.0.0alpha',
541
+                2 => '2.0.0a',
542
+                3 => '=',
543
+            ],
544
+            105 => [
545
+                0 => true,
546
+                1 => '2.0.0beta',
547
+                2 => '2.0.0b',
548
+                3 => '=',
549
+            ],
550
+            106 => [
551
+                0 => true,
552
+                1 => '2.0.0pl',
553
+                2 => '2.0.0p',
554
+                3 => '=',
555
+            ],
556
+            107 => [
557
+                0 => true,
558
+                1 => '2.0.0-rc',
559
+                2 => '2.0.0RC',
560
+                3 => '=',
561
+            ],
562
+        ];
563
+    }
564 564
 }
Please login to merge, or discard this patch.
ecrire/tests/Plugin/PluginVersionCompatibleTest.php 1 patch
Indentation   +462 added lines, -462 removed lines patch added patch discarded remove patch
@@ -13,468 +13,468 @@
 block discarded – undo
13 13
 
14 14
 class PluginVersionCompatibleTest extends TestCase
15 15
 {
16
-	public static function setUpBeforeClass(): void {
17
-		find_in_path('./inc/plugin.php', '', true);
18
-	}
16
+    public static function setUpBeforeClass(): void {
17
+        find_in_path('./inc/plugin.php', '', true);
18
+    }
19 19
 
20
-	#[DataProvider('providerPluginPluginVersionCompatible')]
21
-	public function testPluginPluginVersionCompatible($expected, ...$args): void {
22
-		$actual = plugin_version_compatible(...$args);
23
-		$this->assertSame($expected, $actual);
24
-	}
20
+    #[DataProvider('providerPluginPluginVersionCompatible')]
21
+    public function testPluginPluginVersionCompatible($expected, ...$args): void {
22
+        $actual = plugin_version_compatible(...$args);
23
+        $this->assertSame($expected, $actual);
24
+    }
25 25
 
26
-	public static function providerPluginPluginVersionCompatible(): array {
27
-		return [
28
-			0 => [
29
-				0 => true,
30
-				1 => '[1.0.0;3.0.0]',
31
-				2 => '2',
32
-			],
33
-			1 => [
34
-				0 => true,
35
-				1 => '[1.0.0;3.0.0]',
36
-				2 => '2.0',
37
-			],
38
-			2 => [
39
-				0 => true,
40
-				1 => '[1.0.0;3.0.0]',
41
-				2 => '2.0.0',
42
-			],
43
-			3 => [
44
-				0 => true,
45
-				1 => '[1.0.0;3.0.0]',
46
-				2 => '2.0.0dev',
47
-			],
48
-			4 => [
49
-				0 => true,
50
-				1 => '[1.0.0;3.0.0]',
51
-				2 => '2.0.0alpha',
52
-			],
53
-			5 => [
54
-				0 => true,
55
-				1 => '[1.0.0;3.0.0]',
56
-				2 => '2.0.0beta',
57
-			],
58
-			6 => [
59
-				0 => true,
60
-				1 => '[1.0.0;3.0.0]',
61
-				2 => '2.0.0rc',
62
-			],
63
-			7 => [
64
-				0 => true,
65
-				1 => '[1.0.0;3.0.0]',
66
-				2 => '2.0.0#',
67
-			],
68
-			8 => [
69
-				0 => true,
70
-				1 => '[1.0.0;3.0.0]',
71
-				2 => '2.0.0pl',
72
-			],
73
-			9 => [
74
-				0 => true,
75
-				1 => '[1.0.0;3.0.0]',
76
-				2 => '2.0.1',
77
-			],
78
-			10 => [
79
-				0 => true,
80
-				1 => '[2.0.0;3.0.0]',
81
-				2 => '2',
82
-			],
83
-			11 => [
84
-				0 => true,
85
-				1 => '[2.0.0;3.0.0]',
86
-				2 => '2.0',
87
-			],
88
-			12 => [
89
-				0 => true,
90
-				1 => '[2.0.0;3.0.0]',
91
-				2 => '2.0.0',
92
-			],
93
-			13 => [
94
-				0 => false,
95
-				1 => '[2.0.0;3.0.0]',
96
-				2 => '2.0.0dev',
97
-			],
98
-			14 => [
99
-				0 => false,
100
-				1 => '[2.0.0;3.0.0]',
101
-				2 => '2.0.0alpha',
102
-			],
103
-			15 => [
104
-				0 => false,
105
-				1 => '[2.0.0;3.0.0]',
106
-				2 => '2.0.0beta',
107
-			],
108
-			16 => [
109
-				0 => false,
110
-				1 => '[2.0.0;3.0.0]',
111
-				2 => '2.0.0rc',
112
-			],
113
-			17 => [
114
-				0 => true,
115
-				1 => '[2.0.0;3.0.0]',
116
-				2 => '2.0.0#',
117
-			],
118
-			18 => [
119
-				0 => true,
120
-				1 => '[2.0.0;3.0.0]',
121
-				2 => '2.0.0pl',
122
-			],
123
-			19 => [
124
-				0 => true,
125
-				1 => '[2.0.0;3.0.0]',
126
-				2 => '2.0.1',
127
-			],
128
-			20 => [
129
-				0 => false,
130
-				1 => ']2.0.0;3.0.0]',
131
-				2 => '2',
132
-			],
133
-			21 => [
134
-				0 => false,
135
-				1 => ']2.0.0;3.0.0]',
136
-				2 => '2.0',
137
-			],
138
-			22 => [
139
-				0 => false,
140
-				1 => ']2.0.0;3.0.0]',
141
-				2 => '2.0.0',
142
-			],
143
-			23 => [
144
-				0 => false,
145
-				1 => ']2.0.0;3.0.0]',
146
-				2 => '2.0.0dev',
147
-			],
148
-			24 => [
149
-				0 => false,
150
-				1 => ']2.0.0;3.0.0]',
151
-				2 => '2.0.0alpha',
152
-			],
153
-			25 => [
154
-				0 => false,
155
-				1 => ']2.0.0;3.0.0]',
156
-				2 => '2.0.0beta',
157
-			],
158
-			26 => [
159
-				0 => false,
160
-				1 => ']2.0.0;3.0.0]',
161
-				2 => '2.0.0rc',
162
-			],
163
-			27 => [
164
-				0 => false,
165
-				1 => ']2.0.0;3.0.0]',
166
-				2 => '2.0.0#',
167
-			],
168
-			28 => [
169
-				0 => true,
170
-				1 => ']2.0.0;3.0.0]',
171
-				2 => '2.0.0pl',
172
-			],
173
-			29 => [
174
-				0 => true,
175
-				1 => ']2.0.0;3.0.0]',
176
-				2 => '2.0.1',
177
-			],
178
-			30 => [
179
-				0 => false,
180
-				1 => ')2.0.0;3.0.0]',
181
-				2 => '2',
182
-			],
183
-			31 => [
184
-				0 => false,
185
-				1 => ')2.0.0;3.0.0]',
186
-				2 => '2.0',
187
-			],
188
-			32 => [
189
-				0 => false,
190
-				1 => ')2.0.0;3.0.0]',
191
-				2 => '2.0.0',
192
-			],
193
-			33 => [
194
-				0 => false,
195
-				1 => ')2.0.0;3.0.0]',
196
-				2 => '2.0.0dev',
197
-			],
198
-			34 => [
199
-				0 => false,
200
-				1 => ')2.0.0;3.0.0]',
201
-				2 => '2.0.0alpha',
202
-			],
203
-			35 => [
204
-				0 => false,
205
-				1 => ')2.0.0;3.0.0]',
206
-				2 => '2.0.0beta',
207
-			],
208
-			36 => [
209
-				0 => false,
210
-				1 => ')2.0.0;3.0.0]',
211
-				2 => '2.0.0rc',
212
-			],
213
-			37 => [
214
-				0 => false,
215
-				1 => ')2.0.0;3.0.0]',
216
-				2 => '2.0.0#',
217
-			],
218
-			38 => [
219
-				0 => false,
220
-				1 => ')2.0.0;3.0.0]',
221
-				2 => '2.0.0pl',
222
-			],
223
-			39 => [
224
-				0 => false,
225
-				1 => ')2.0.0;3.0.0]',
226
-				2 => '2.0.1',
227
-			],
228
-			40 => [
229
-				0 => true,
230
-				1 => '[1.0.0;2.0.0]',
231
-				2 => '2',
232
-			],
233
-			41 => [
234
-				0 => true,
235
-				1 => '[1.0.0;2.0.0]',
236
-				2 => '2.0',
237
-			],
238
-			42 => [
239
-				0 => true,
240
-				1 => '[1.0.0;2.0.0]',
241
-				2 => '2.0.0',
242
-			],
243
-			43 => [
244
-				0 => true,
245
-				1 => '[1.0.0;2.0.0]',
246
-				2 => '2.0.0dev',
247
-			],
248
-			44 => [
249
-				0 => true,
250
-				1 => '[1.0.0;2.0.0]',
251
-				2 => '2.0.0alpha',
252
-			],
253
-			45 => [
254
-				0 => true,
255
-				1 => '[1.0.0;2.0.0]',
256
-				2 => '2.0.0beta',
257
-			],
258
-			46 => [
259
-				0 => true,
260
-				1 => '[1.0.0;2.0.0]',
261
-				2 => '2.0.0rc',
262
-			],
263
-			47 => [
264
-				0 => true,
265
-				1 => '[1.0.0;2.0.0]',
266
-				2 => '2.0.0#',
267
-			],
268
-			48 => [
269
-				0 => false,
270
-				1 => '[1.0.0;2.0.0]',
271
-				2 => '2.0.0pl',
272
-			],
273
-			49 => [
274
-				0 => false,
275
-				1 => '[1.0.0;2.0.0]',
276
-				2 => '2.0.1',
277
-			],
278
-			50 => [
279
-				0 => false,
280
-				1 => '[1.0.0;2.0.0[',
281
-				2 => '2',
282
-			],
283
-			51 => [
284
-				0 => false,
285
-				1 => '[1.0.0;2.0.0[',
286
-				2 => '2.0',
287
-			],
288
-			52 => [
289
-				0 => false,
290
-				1 => '[1.0.0;2.0.0[',
291
-				2 => '2.0.0',
292
-			],
293
-			53 => [
294
-				0 => true,
295
-				1 => '[1.0.0;2.0.0[',
296
-				2 => '2.0.0dev',
297
-			],
298
-			54 => [
299
-				0 => true,
300
-				1 => '[1.0.0;2.0.0[',
301
-				2 => '2.0.0alpha',
302
-			],
303
-			55 => [
304
-				0 => true,
305
-				1 => '[1.0.0;2.0.0[',
306
-				2 => '2.0.0beta',
307
-			],
308
-			56 => [
309
-				0 => true,
310
-				1 => '[1.0.0;2.0.0[',
311
-				2 => '2.0.0rc',
312
-			],
313
-			57 => [
314
-				0 => false,
315
-				1 => '[1.0.0;2.0.0[',
316
-				2 => '2.0.0#',
317
-			],
318
-			58 => [
319
-				0 => false,
320
-				1 => '[1.0.0;2.0.0[',
321
-				2 => '2.0.0pl',
322
-			],
323
-			59 => [
324
-				0 => false,
325
-				1 => '[1.0.0;2.0.0[',
326
-				2 => '2.0.1',
327
-			],
328
-			60 => [
329
-				0 => false,
330
-				1 => '[1.0.0;2.0.*[',
331
-				2 => '2',
332
-			],
333
-			61 => [
334
-				0 => false,
335
-				1 => '[1.0.0;2.0.*[',
336
-				2 => '2.0',
337
-			],
338
-			62 => [
339
-				0 => false,
340
-				1 => '[1.0.0;2.0.*[',
341
-				2 => '2.0.0',
342
-			],
343
-			63 => [
344
-				0 => true,
345
-				1 => '[1.0.0;2.0.*[',
346
-				2 => '2.0.0dev',
347
-			],
348
-			64 => [
349
-				0 => true,
350
-				1 => '[1.0.0;2.0.*[',
351
-				2 => '2.0.0alpha',
352
-			],
353
-			65 => [
354
-				0 => true,
355
-				1 => '[1.0.0;2.0.*[',
356
-				2 => '2.0.0beta',
357
-			],
358
-			66 => [
359
-				0 => true,
360
-				1 => '[1.0.0;2.0.*[',
361
-				2 => '2.0.0rc',
362
-			],
363
-			67 => [
364
-				0 => false,
365
-				1 => '[1.0.0;2.0.*[',
366
-				2 => '2.0.0#',
367
-			],
368
-			68 => [
369
-				0 => false,
370
-				1 => '[1.0.0;2.0.*[',
371
-				2 => '2.0.0pl',
372
-			],
373
-			69 => [
374
-				0 => false,
375
-				1 => '[1.0.0;2.0.*[',
376
-				2 => '2.0.1',
377
-			],
378
-			70 => [
379
-				0 => true,
380
-				1 => '[1.0.0;2.0.*]',
381
-				2 => '2',
382
-			],
383
-			71 => [
384
-				0 => true,
385
-				1 => '[1.0.0;2.0.*]',
386
-				2 => '2.0',
387
-			],
388
-			72 => [
389
-				0 => true,
390
-				1 => '[1.0.0;2.0.*]',
391
-				2 => '2.0.0',
392
-			],
393
-			73 => [
394
-				0 => true,
395
-				1 => '[1.0.0;2.0.*]',
396
-				2 => '2.0.0dev',
397
-			],
398
-			74 => [
399
-				0 => true,
400
-				1 => '[1.0.0;2.0.*]',
401
-				2 => '2.0.0alpha',
402
-			],
403
-			75 => [
404
-				0 => true,
405
-				1 => '[1.0.0;2.0.*]',
406
-				2 => '2.0.0beta',
407
-			],
408
-			76 => [
409
-				0 => true,
410
-				1 => '[1.0.0;2.0.*]',
411
-				2 => '2.0.0rc',
412
-			],
413
-			77 => [
414
-				0 => true,
415
-				1 => '[1.0.0;2.0.*]',
416
-				2 => '2.0.0#',
417
-			],
418
-			78 => [
419
-				0 => true,
420
-				1 => '[1.0.0;2.0.*]',
421
-				2 => '2.0.0pl',
422
-			],
423
-			79 => [
424
-				0 => true,
425
-				1 => '[1.0.0;2.0.*]',
426
-				2 => '2.0.1',
427
-			],
428
-			80 => [
429
-				0 => true,
430
-				1 => '[1.0.0;2.*]',
431
-				2 => '2',
432
-			],
433
-			81 => [
434
-				0 => true,
435
-				1 => '[1.0.0;2.*]',
436
-				2 => '2.0',
437
-			],
438
-			82 => [
439
-				0 => true,
440
-				1 => '[1.0.0;2.*]',
441
-				2 => '2.0.0',
442
-			],
443
-			83 => [
444
-				0 => true,
445
-				1 => '[1.0.0;2.*]',
446
-				2 => '2.0.0dev',
447
-			],
448
-			84 => [
449
-				0 => true,
450
-				1 => '[1.0.0;2.*]',
451
-				2 => '2.0.0alpha',
452
-			],
453
-			85 => [
454
-				0 => true,
455
-				1 => '[1.0.0;2.*]',
456
-				2 => '2.0.0beta',
457
-			],
458
-			86 => [
459
-				0 => true,
460
-				1 => '[1.0.0;2.*]',
461
-				2 => '2.0.0rc',
462
-			],
463
-			87 => [
464
-				0 => true,
465
-				1 => '[1.0.0;2.*]',
466
-				2 => '2.0.0#',
467
-			],
468
-			88 => [
469
-				0 => true,
470
-				1 => '[1.0.0;2.*]',
471
-				2 => '2.0.0pl',
472
-			],
473
-			89 => [
474
-				0 => true,
475
-				1 => '[1.0.0;2.*]',
476
-				2 => '2.0.1',
477
-			],
478
-		];
479
-	}
26
+    public static function providerPluginPluginVersionCompatible(): array {
27
+        return [
28
+            0 => [
29
+                0 => true,
30
+                1 => '[1.0.0;3.0.0]',
31
+                2 => '2',
32
+            ],
33
+            1 => [
34
+                0 => true,
35
+                1 => '[1.0.0;3.0.0]',
36
+                2 => '2.0',
37
+            ],
38
+            2 => [
39
+                0 => true,
40
+                1 => '[1.0.0;3.0.0]',
41
+                2 => '2.0.0',
42
+            ],
43
+            3 => [
44
+                0 => true,
45
+                1 => '[1.0.0;3.0.0]',
46
+                2 => '2.0.0dev',
47
+            ],
48
+            4 => [
49
+                0 => true,
50
+                1 => '[1.0.0;3.0.0]',
51
+                2 => '2.0.0alpha',
52
+            ],
53
+            5 => [
54
+                0 => true,
55
+                1 => '[1.0.0;3.0.0]',
56
+                2 => '2.0.0beta',
57
+            ],
58
+            6 => [
59
+                0 => true,
60
+                1 => '[1.0.0;3.0.0]',
61
+                2 => '2.0.0rc',
62
+            ],
63
+            7 => [
64
+                0 => true,
65
+                1 => '[1.0.0;3.0.0]',
66
+                2 => '2.0.0#',
67
+            ],
68
+            8 => [
69
+                0 => true,
70
+                1 => '[1.0.0;3.0.0]',
71
+                2 => '2.0.0pl',
72
+            ],
73
+            9 => [
74
+                0 => true,
75
+                1 => '[1.0.0;3.0.0]',
76
+                2 => '2.0.1',
77
+            ],
78
+            10 => [
79
+                0 => true,
80
+                1 => '[2.0.0;3.0.0]',
81
+                2 => '2',
82
+            ],
83
+            11 => [
84
+                0 => true,
85
+                1 => '[2.0.0;3.0.0]',
86
+                2 => '2.0',
87
+            ],
88
+            12 => [
89
+                0 => true,
90
+                1 => '[2.0.0;3.0.0]',
91
+                2 => '2.0.0',
92
+            ],
93
+            13 => [
94
+                0 => false,
95
+                1 => '[2.0.0;3.0.0]',
96
+                2 => '2.0.0dev',
97
+            ],
98
+            14 => [
99
+                0 => false,
100
+                1 => '[2.0.0;3.0.0]',
101
+                2 => '2.0.0alpha',
102
+            ],
103
+            15 => [
104
+                0 => false,
105
+                1 => '[2.0.0;3.0.0]',
106
+                2 => '2.0.0beta',
107
+            ],
108
+            16 => [
109
+                0 => false,
110
+                1 => '[2.0.0;3.0.0]',
111
+                2 => '2.0.0rc',
112
+            ],
113
+            17 => [
114
+                0 => true,
115
+                1 => '[2.0.0;3.0.0]',
116
+                2 => '2.0.0#',
117
+            ],
118
+            18 => [
119
+                0 => true,
120
+                1 => '[2.0.0;3.0.0]',
121
+                2 => '2.0.0pl',
122
+            ],
123
+            19 => [
124
+                0 => true,
125
+                1 => '[2.0.0;3.0.0]',
126
+                2 => '2.0.1',
127
+            ],
128
+            20 => [
129
+                0 => false,
130
+                1 => ']2.0.0;3.0.0]',
131
+                2 => '2',
132
+            ],
133
+            21 => [
134
+                0 => false,
135
+                1 => ']2.0.0;3.0.0]',
136
+                2 => '2.0',
137
+            ],
138
+            22 => [
139
+                0 => false,
140
+                1 => ']2.0.0;3.0.0]',
141
+                2 => '2.0.0',
142
+            ],
143
+            23 => [
144
+                0 => false,
145
+                1 => ']2.0.0;3.0.0]',
146
+                2 => '2.0.0dev',
147
+            ],
148
+            24 => [
149
+                0 => false,
150
+                1 => ']2.0.0;3.0.0]',
151
+                2 => '2.0.0alpha',
152
+            ],
153
+            25 => [
154
+                0 => false,
155
+                1 => ']2.0.0;3.0.0]',
156
+                2 => '2.0.0beta',
157
+            ],
158
+            26 => [
159
+                0 => false,
160
+                1 => ']2.0.0;3.0.0]',
161
+                2 => '2.0.0rc',
162
+            ],
163
+            27 => [
164
+                0 => false,
165
+                1 => ']2.0.0;3.0.0]',
166
+                2 => '2.0.0#',
167
+            ],
168
+            28 => [
169
+                0 => true,
170
+                1 => ']2.0.0;3.0.0]',
171
+                2 => '2.0.0pl',
172
+            ],
173
+            29 => [
174
+                0 => true,
175
+                1 => ']2.0.0;3.0.0]',
176
+                2 => '2.0.1',
177
+            ],
178
+            30 => [
179
+                0 => false,
180
+                1 => ')2.0.0;3.0.0]',
181
+                2 => '2',
182
+            ],
183
+            31 => [
184
+                0 => false,
185
+                1 => ')2.0.0;3.0.0]',
186
+                2 => '2.0',
187
+            ],
188
+            32 => [
189
+                0 => false,
190
+                1 => ')2.0.0;3.0.0]',
191
+                2 => '2.0.0',
192
+            ],
193
+            33 => [
194
+                0 => false,
195
+                1 => ')2.0.0;3.0.0]',
196
+                2 => '2.0.0dev',
197
+            ],
198
+            34 => [
199
+                0 => false,
200
+                1 => ')2.0.0;3.0.0]',
201
+                2 => '2.0.0alpha',
202
+            ],
203
+            35 => [
204
+                0 => false,
205
+                1 => ')2.0.0;3.0.0]',
206
+                2 => '2.0.0beta',
207
+            ],
208
+            36 => [
209
+                0 => false,
210
+                1 => ')2.0.0;3.0.0]',
211
+                2 => '2.0.0rc',
212
+            ],
213
+            37 => [
214
+                0 => false,
215
+                1 => ')2.0.0;3.0.0]',
216
+                2 => '2.0.0#',
217
+            ],
218
+            38 => [
219
+                0 => false,
220
+                1 => ')2.0.0;3.0.0]',
221
+                2 => '2.0.0pl',
222
+            ],
223
+            39 => [
224
+                0 => false,
225
+                1 => ')2.0.0;3.0.0]',
226
+                2 => '2.0.1',
227
+            ],
228
+            40 => [
229
+                0 => true,
230
+                1 => '[1.0.0;2.0.0]',
231
+                2 => '2',
232
+            ],
233
+            41 => [
234
+                0 => true,
235
+                1 => '[1.0.0;2.0.0]',
236
+                2 => '2.0',
237
+            ],
238
+            42 => [
239
+                0 => true,
240
+                1 => '[1.0.0;2.0.0]',
241
+                2 => '2.0.0',
242
+            ],
243
+            43 => [
244
+                0 => true,
245
+                1 => '[1.0.0;2.0.0]',
246
+                2 => '2.0.0dev',
247
+            ],
248
+            44 => [
249
+                0 => true,
250
+                1 => '[1.0.0;2.0.0]',
251
+                2 => '2.0.0alpha',
252
+            ],
253
+            45 => [
254
+                0 => true,
255
+                1 => '[1.0.0;2.0.0]',
256
+                2 => '2.0.0beta',
257
+            ],
258
+            46 => [
259
+                0 => true,
260
+                1 => '[1.0.0;2.0.0]',
261
+                2 => '2.0.0rc',
262
+            ],
263
+            47 => [
264
+                0 => true,
265
+                1 => '[1.0.0;2.0.0]',
266
+                2 => '2.0.0#',
267
+            ],
268
+            48 => [
269
+                0 => false,
270
+                1 => '[1.0.0;2.0.0]',
271
+                2 => '2.0.0pl',
272
+            ],
273
+            49 => [
274
+                0 => false,
275
+                1 => '[1.0.0;2.0.0]',
276
+                2 => '2.0.1',
277
+            ],
278
+            50 => [
279
+                0 => false,
280
+                1 => '[1.0.0;2.0.0[',
281
+                2 => '2',
282
+            ],
283
+            51 => [
284
+                0 => false,
285
+                1 => '[1.0.0;2.0.0[',
286
+                2 => '2.0',
287
+            ],
288
+            52 => [
289
+                0 => false,
290
+                1 => '[1.0.0;2.0.0[',
291
+                2 => '2.0.0',
292
+            ],
293
+            53 => [
294
+                0 => true,
295
+                1 => '[1.0.0;2.0.0[',
296
+                2 => '2.0.0dev',
297
+            ],
298
+            54 => [
299
+                0 => true,
300
+                1 => '[1.0.0;2.0.0[',
301
+                2 => '2.0.0alpha',
302
+            ],
303
+            55 => [
304
+                0 => true,
305
+                1 => '[1.0.0;2.0.0[',
306
+                2 => '2.0.0beta',
307
+            ],
308
+            56 => [
309
+                0 => true,
310
+                1 => '[1.0.0;2.0.0[',
311
+                2 => '2.0.0rc',
312
+            ],
313
+            57 => [
314
+                0 => false,
315
+                1 => '[1.0.0;2.0.0[',
316
+                2 => '2.0.0#',
317
+            ],
318
+            58 => [
319
+                0 => false,
320
+                1 => '[1.0.0;2.0.0[',
321
+                2 => '2.0.0pl',
322
+            ],
323
+            59 => [
324
+                0 => false,
325
+                1 => '[1.0.0;2.0.0[',
326
+                2 => '2.0.1',
327
+            ],
328
+            60 => [
329
+                0 => false,
330
+                1 => '[1.0.0;2.0.*[',
331
+                2 => '2',
332
+            ],
333
+            61 => [
334
+                0 => false,
335
+                1 => '[1.0.0;2.0.*[',
336
+                2 => '2.0',
337
+            ],
338
+            62 => [
339
+                0 => false,
340
+                1 => '[1.0.0;2.0.*[',
341
+                2 => '2.0.0',
342
+            ],
343
+            63 => [
344
+                0 => true,
345
+                1 => '[1.0.0;2.0.*[',
346
+                2 => '2.0.0dev',
347
+            ],
348
+            64 => [
349
+                0 => true,
350
+                1 => '[1.0.0;2.0.*[',
351
+                2 => '2.0.0alpha',
352
+            ],
353
+            65 => [
354
+                0 => true,
355
+                1 => '[1.0.0;2.0.*[',
356
+                2 => '2.0.0beta',
357
+            ],
358
+            66 => [
359
+                0 => true,
360
+                1 => '[1.0.0;2.0.*[',
361
+                2 => '2.0.0rc',
362
+            ],
363
+            67 => [
364
+                0 => false,
365
+                1 => '[1.0.0;2.0.*[',
366
+                2 => '2.0.0#',
367
+            ],
368
+            68 => [
369
+                0 => false,
370
+                1 => '[1.0.0;2.0.*[',
371
+                2 => '2.0.0pl',
372
+            ],
373
+            69 => [
374
+                0 => false,
375
+                1 => '[1.0.0;2.0.*[',
376
+                2 => '2.0.1',
377
+            ],
378
+            70 => [
379
+                0 => true,
380
+                1 => '[1.0.0;2.0.*]',
381
+                2 => '2',
382
+            ],
383
+            71 => [
384
+                0 => true,
385
+                1 => '[1.0.0;2.0.*]',
386
+                2 => '2.0',
387
+            ],
388
+            72 => [
389
+                0 => true,
390
+                1 => '[1.0.0;2.0.*]',
391
+                2 => '2.0.0',
392
+            ],
393
+            73 => [
394
+                0 => true,
395
+                1 => '[1.0.0;2.0.*]',
396
+                2 => '2.0.0dev',
397
+            ],
398
+            74 => [
399
+                0 => true,
400
+                1 => '[1.0.0;2.0.*]',
401
+                2 => '2.0.0alpha',
402
+            ],
403
+            75 => [
404
+                0 => true,
405
+                1 => '[1.0.0;2.0.*]',
406
+                2 => '2.0.0beta',
407
+            ],
408
+            76 => [
409
+                0 => true,
410
+                1 => '[1.0.0;2.0.*]',
411
+                2 => '2.0.0rc',
412
+            ],
413
+            77 => [
414
+                0 => true,
415
+                1 => '[1.0.0;2.0.*]',
416
+                2 => '2.0.0#',
417
+            ],
418
+            78 => [
419
+                0 => true,
420
+                1 => '[1.0.0;2.0.*]',
421
+                2 => '2.0.0pl',
422
+            ],
423
+            79 => [
424
+                0 => true,
425
+                1 => '[1.0.0;2.0.*]',
426
+                2 => '2.0.1',
427
+            ],
428
+            80 => [
429
+                0 => true,
430
+                1 => '[1.0.0;2.*]',
431
+                2 => '2',
432
+            ],
433
+            81 => [
434
+                0 => true,
435
+                1 => '[1.0.0;2.*]',
436
+                2 => '2.0',
437
+            ],
438
+            82 => [
439
+                0 => true,
440
+                1 => '[1.0.0;2.*]',
441
+                2 => '2.0.0',
442
+            ],
443
+            83 => [
444
+                0 => true,
445
+                1 => '[1.0.0;2.*]',
446
+                2 => '2.0.0dev',
447
+            ],
448
+            84 => [
449
+                0 => true,
450
+                1 => '[1.0.0;2.*]',
451
+                2 => '2.0.0alpha',
452
+            ],
453
+            85 => [
454
+                0 => true,
455
+                1 => '[1.0.0;2.*]',
456
+                2 => '2.0.0beta',
457
+            ],
458
+            86 => [
459
+                0 => true,
460
+                1 => '[1.0.0;2.*]',
461
+                2 => '2.0.0rc',
462
+            ],
463
+            87 => [
464
+                0 => true,
465
+                1 => '[1.0.0;2.*]',
466
+                2 => '2.0.0#',
467
+            ],
468
+            88 => [
469
+                0 => true,
470
+                1 => '[1.0.0;2.*]',
471
+                2 => '2.0.0pl',
472
+            ],
473
+            89 => [
474
+                0 => true,
475
+                1 => '[1.0.0;2.*]',
476
+                2 => '2.0.1',
477
+            ],
478
+        ];
479
+    }
480 480
 }
Please login to merge, or discard this patch.
ecrire/tests/Api/AutoriserTest.php 2 patches
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -8,28 +8,28 @@
 block discarded – undo
8 8
 
9 9
 class AutoriserTest extends TestCase
10 10
 {
11
-	public static function setUpBeforeClass(): void {
12
-		include_spip('inc/autoriser');
13
-		require_once(__DIR__ . '/data/autoriser.php');
14
-	}
11
+    public static function setUpBeforeClass(): void {
12
+        include_spip('inc/autoriser');
13
+        require_once(__DIR__ . '/data/autoriser.php');
14
+    }
15 15
 
16
-	public function testAutoriserOkNiet(): void {
17
-		$this->assertFalse(autoriser('niet'));
18
-		$this->assertTrue(autoriser('ok'));
19
-	}
16
+    public function testAutoriserOkNiet(): void {
17
+        $this->assertFalse(autoriser('niet'));
18
+        $this->assertTrue(autoriser('ok'));
19
+    }
20 20
 
21
-	public function testAutoriserNouvelleFonction(): void {
22
-		$this->assertTrue(autoriser('chaparder'));
23
-		$this->assertFalse(autoriser('paschaparder'));
24
-		$this->assertTrue(autoriser('chaparder', 'velo'));
25
-		$this->assertTrue(autoriser('velo', 'chaparder'));
26
-		$this->assertTrue(autoriser('chaparder', 'carottes'));
27
-		$this->assertTrue(autoriser('carottes', 'chaparder'));
28
-	}
21
+    public function testAutoriserNouvelleFonction(): void {
22
+        $this->assertTrue(autoriser('chaparder'));
23
+        $this->assertFalse(autoriser('paschaparder'));
24
+        $this->assertTrue(autoriser('chaparder', 'velo'));
25
+        $this->assertTrue(autoriser('velo', 'chaparder'));
26
+        $this->assertTrue(autoriser('chaparder', 'carottes'));
27
+        $this->assertTrue(autoriser('carottes', 'chaparder'));
28
+    }
29 29
 
30
-	public function testAutoriserIdentifiant(): void {
31
-		$this->assertFalse(autoriser('unidentifiant'));
32
-		$this->assertTrue(autoriser('unidentifiant', '', 1));
33
-		$this->assertFalse(autoriser('unidentifiant', '', 2));
34
-	}
30
+    public function testAutoriserIdentifiant(): void {
31
+        $this->assertFalse(autoriser('unidentifiant'));
32
+        $this->assertTrue(autoriser('unidentifiant', '', 1));
33
+        $this->assertFalse(autoriser('unidentifiant', '', 2));
34
+    }
35 35
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
 {
11 11
 	public static function setUpBeforeClass(): void {
12 12
 		include_spip('inc/autoriser');
13
-		require_once(__DIR__ . '/data/autoriser.php');
13
+		require_once(__DIR__.'/data/autoriser.php');
14 14
 	}
15 15
 
16 16
 	public function testAutoriserOkNiet(): void {
Please login to merge, or discard this patch.
ecrire/tests/Api/data/autoriser.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -3,25 +3,25 @@
 block discarded – undo
3 3
 declare(strict_types=1);
4 4
 
5 5
 function autoriser_chaparder(string $faire, string $type, $id, array $qui, array $opt): bool {
6
-	return true;
6
+    return true;
7 7
 }
8 8
 
9 9
 function autoriser_paschaparder(string $faire, string $type, $id, array $qui, array $opt): bool {
10
-	return false;
10
+    return false;
11 11
 }
12 12
 
13 13
 function autoriser_chaparder_velo(string $faire, string $type, $id, array $qui, array $opt): bool {
14
-	return true;
14
+    return true;
15 15
 }
16 16
 
17 17
 function autoriser_chaparder_carottes_dist(string $faire, string $type, $id, array $qui, array $opt): bool {
18
-	return false;
18
+    return false;
19 19
 }
20 20
 
21 21
 function autoriser_chaparder_carottes(string $faire, string $type, $id, array $qui, array $opt): bool {
22
-	return true;
22
+    return true;
23 23
 }
24 24
 
25 25
 function autoriser_unidentifiant(string $faire, string $type, $id, array $qui, array $opt): bool {
26
-	return $id === 1;
26
+    return $id === 1;
27 27
 }
Please login to merge, or discard this patch.