Permalink
Browse files

MINOR Removed unnecessary files from sapphire/thirdpary/spyc

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@92495 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
1 parent 2f32c87 commit 75d3815d290489e4e2492533e484dc62bacf5ffc @chillu chillu committed Nov 21, 2009
@@ -0,0 +1,2 @@
+examples/
+tests/
@@ -1,37 +0,0 @@
-<?php
-
-#
-# S P Y C
-# a simple php yaml class
-# v0.2(.5)
-#
-# author: [chris wanstrath, chris@ozmm.org]
-# websites: [http://www.yaml.org, http://spyc.sourceforge.net/]
-# license: [MIT License, http://www.opensource.org/licenses/mit-license.php]
-# copyright: (c) 2005-2006 Chris Wanstrath
-#
-# Feel free to dump an array to YAML, and then to load that YAML back into an
-# array. This is a good way to test the limitations of the parser and maybe
-# learn some basic YAML.
-#
-
-include('../spyc.php');
-
-$array[] = 'Sequence item';
-$array['The Key'] = 'Mapped value';
-$array[] = array('A sequence','of a sequence');
-$array[] = array('first' => 'A sequence','second' => 'of mapped values');
-$array['Mapped'] = array('A sequence','which is mapped');
-$array['A Note'] = 'What if your text is too long?';
-$array['Another Note'] = 'If that is the case, the dumper will probably fold your text by using a block. Kinda like this.';
-$array['The trick?'] = 'The trick is that we overrode the default indent, 2, to 4 and the default wordwrap, 40, to 60.';
-$array['Old Dog'] = "And if you want\n to preserve line breaks, \ngo ahead!";
-$array['key:withcolon'] = "Should support this to";
-
-$yaml = Spyc::YAMLDump($array,4,60);
-
-echo '<pre>A PHP array run through YAMLDump():<br/>';
-print_r($yaml);
-echo '</pre>';
-
-?>
@@ -1,23 +0,0 @@
-<?php
-
-#
-# S P Y C
-# a simple php yaml class
-# v0.2(.5)
-#
-# author: [chris wanstrath, chris@ozmm.org]
-# websites: [http://www.yaml.org, http://spyc.sourceforge.net/]
-# license: [MIT License, http://www.opensource.org/licenses/mit-license.php]
-# copyright: (c) 2005-2006 Chris Wanstrath
-#
-
-include('../spyc.php');
-
-$array = Spyc::YAMLLoad('../spyc.yaml');
-
-echo '<pre><a href="spyc.yaml">spyc.yaml</a> loaded into PHP:<br/>';
-print_r($array);
-echo '</pre>';
-
-
-?>
@@ -1,58 +0,0 @@
-<?php
-
-require_once ("../spyc.php");
-
-class DumpTest extends PHPUnit_Framework_TestCase {
-
- private $files_to_test = array();
-
- public function setUp() {
- $this->files_to_test = array ('../spyc.yaml', 'failing1.yaml', 'indent_1.yaml', 'quotes.yaml');
- }
-
- public function testDump() {
- foreach ($this->files_to_test as $file) {
- $yaml = spyc_load(file_get_contents($file));
- $dump = Spyc::YAMLDump ($yaml);
- $yaml_after_dump = Spyc::YAMLLoad ($dump);
- $this->assertEquals ($yaml, $yaml_after_dump);
- }
- }
-
- public function testDumpWithQuotes() {
- $Spyc = new Spyc();
- $Spyc->setting_dump_force_quotes = true;
- foreach ($this->files_to_test as $file) {
- $yaml = $Spyc->load(file_get_contents($file));
- $dump = $Spyc->dump ($yaml);
- $yaml_after_dump = Spyc::YAMLLoad ($dump);
- $this->assertEquals ($yaml, $yaml_after_dump);
- }
- }
-
- public function testDumpArrays() {
- $dump = Spyc::YAMLDump(array ('item1', 'item2', 'item3'));
- $awaiting = "---\n- item1\n- item2\n- item3\n";
- $this->assertEquals ($awaiting, $dump);
- }
-
- public function testDumpNumerics() {
- $dump = Spyc::YAMLDump(array ('404', '405', '500'));
- $awaiting = "---\n- 404\n- 405\n- 500\n";
- $this->assertEquals ($awaiting, $dump);
- }
-
- public function testDumpAsterisks() {
- $dump = Spyc::YAMLDump(array ('*'));
- $awaiting = "---\n- '*'\n";
- $this->assertEquals ($awaiting, $dump);
- }
-
-
- public function testEmpty() {
- $dump = Spyc::YAMLDump(array("foo" => array()));
- $awaiting = "---\nfoo: [ ]\n";
- $this->assertEquals ($awaiting, $dump);
- }
-
-}
@@ -1,57 +0,0 @@
-<?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']);
- }
-
-}
Oops, something went wrong.

0 comments on commit 75d3815

Please sign in to comment.