summaryrefslogtreecommitdiff
path: root/includes/spyc/tests/IndentTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/spyc/tests/IndentTest.php')
-rw-r--r--includes/spyc/tests/IndentTest.php57
1 files changed, 57 insertions, 0 deletions
diff --git a/includes/spyc/tests/IndentTest.php b/includes/spyc/tests/IndentTest.php
new file mode 100644
index 0000000..482d8e4
--- /dev/null
+++ b/includes/spyc/tests/IndentTest.php
@@ -0,0 +1,57 @@
+<?php
+
+require_once ("../spyc.php");
+
+class IndentTest extends PHPUnit_Framework_TestCase {
+
+ protected $Y;
+
+ protected function setUp() {
+ $this->Y = Spyc::YAMLLoad("indent_1.yaml");
+ }
+
+ public function testIndent_1() {
+ $this->assertEquals (array ('child_1' => 2, 'child_2' => 0, 'child_3' => 1), $this->Y['root']);
+ }
+
+ public function testIndent_2() {
+ $this->assertEquals (array ('child_1' => 1, 'child_2' => 2), $this->Y['root2']);
+ }
+
+ public function testIndent_3() {
+ $this->assertEquals (array (array ('resolutions' => array (1024 => 768, 1920 => 1200), 'producer' => 'Nec')), $this->Y['display']);
+ }
+
+ public function testIndent_4() {
+ $this->assertEquals (array (
+ array ('resolutions' => array (1024 => 768)),
+ array ('resolutions' => array (1920 => 1200)),
+ ), $this->Y['displays']);
+ }
+
+ public function testIndent_5() {
+ $this->assertEquals (array (array (
+ 'row' => 0,
+ 'col' => 0,
+ 'headsets_affected' => array (
+ array (
+ 'ports' => array (0),
+ 'side' => 'left',
+ )
+ ),
+ 'switch_function' => array (
+ 'ics_ptt' => true
+ )
+ )), $this->Y['nested_hashes_and_seqs']);
+ }
+
+ public function testIndent_6() {
+ $this->assertEquals (array (
+ 'h' => array (
+ array ('a' => 'b', 'a1' => 'b1'),
+ array ('c' => 'd')
+ )
+ ), $this->Y['easier_nest']);
+ }
+
+} \ No newline at end of file