]> scripts.mit.edu Git - autoinstalls/mediawiki.git/blob - vendor/mustangostang/spyc/tests/IndentTest.php
MediaWiki 1.30.2
[autoinstalls/mediawiki.git] / vendor / mustangostang / spyc / tests / IndentTest.php
1 <?php
2
3 require_once ("../Spyc.php");
4
5 class IndentTest extends PHPUnit_Framework_TestCase {
6
7     protected $Y;
8
9     protected function setUp() {
10         $this->Y = Spyc::YAMLLoad("indent_1.yaml");
11     }
12
13     public function testIndent_1() {
14         $this->assertEquals (array ('child_1' => 2, 'child_2' => 0, 'child_3' => 1), $this->Y['root']);
15     }
16
17     public function testIndent_2() {
18         $this->assertEquals (array ('child_1' => 1, 'child_2' => 2), $this->Y['root2']);
19     }
20
21     public function testIndent_3() {
22         $this->assertEquals (array (array ('resolutions' => array (1024 => 768, 1920 => 1200), 'producer' => 'Nec')), $this->Y['display']);
23     }
24
25     public function testIndent_4() {
26         $this->assertEquals (array (
27             array ('resolutions' => array (1024 => 768)),
28             array ('resolutions' => array (1920 => 1200)),
29         ), $this->Y['displays']);
30     }
31
32     public function testIndent_5() {
33         $this->assertEquals (array (array (
34             'row' => 0,
35             'col' => 0,
36             'headsets_affected' => array (
37                 array (
38                     'ports' => array (0),
39                     'side' => 'left',
40                 )
41             ),
42             'switch_function' => array (
43                 'ics_ptt' => true
44             )
45         )), $this->Y['nested_hashes_and_seqs']);
46     }
47
48     public function testIndent_6() {
49         $this->assertEquals (array (
50             'h' => array (
51                 array ('a' => 'b', 'a1' => 'b1'),
52                 array ('c' => 'd')
53             )
54         ), $this->Y['easier_nest']);
55     }
56
57     public function testIndent_space() {
58         $this->assertEquals ("By four\n  spaces", $this->Y['one_space']);
59     }
60
61     public function testListAndComment() {
62         $this->assertEquals (array ('one', 'two', 'three'), $this->Y['list_and_comment']);
63     }
64
65     public function testAnchorAndAlias() {
66         $this->assertEquals (array ('database' => 'rails_dev', 'adapter' => 'mysql', 'host' => 'localhost'), $this->Y['development']);
67         $this->assertEquals (array (1 => 'abc'), $this->Y['zzz']);
68     }
69
70 }