FILE: LINE:
34 |YAML Data dumped back:'; 22 | -------------------------------------------------------------------------------- /ThinkPHP/Library/Vendor/spyc/php4/5to4.php: -------------------------------------------------------------------------------- 1 | ', $code); 13 | $f = fopen ($dest, 'w'); 14 | fwrite($f, $code); 15 | fclose ($f); 16 | print "Written to $dest.\n"; 17 | } -------------------------------------------------------------------------------- /ThinkPHP/Library/Vendor/spyc/tests/IndentTest.php: -------------------------------------------------------------------------------- 1 | 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 | } 66 | -------------------------------------------------------------------------------- /ThinkPHP/Library/Vendor/spyc/tests/RoundTripTest.php: -------------------------------------------------------------------------------- 1 | $a))); } 6 | 7 | 8 | class RoundTripTest extends PHPUnit_Framework_TestCase { 9 | 10 | protected function setUp() { 11 | } 12 | 13 | public function testNull() { 14 | $this->assertEquals (array ('x' => null), roundTrip (null)); 15 | } 16 | 17 | public function testY() { 18 | $this->assertEquals (array ('x' => 'y'), roundTrip ('y')); 19 | } 20 | 21 | public function testExclam() { 22 | $this->assertEquals (array ('x' => '!yeah'), roundTrip ('!yeah')); 23 | } 24 | 25 | public function test5() { 26 | $this->assertEquals (array ('x' => '5'), roundTrip ('5')); 27 | } 28 | 29 | public function testSpaces() { 30 | $this->assertEquals (array ('x' => 'x '), roundTrip ('x ')); 31 | } 32 | 33 | public function testApostrophes() { 34 | $this->assertEquals (array ('x' => "'biz'"), roundTrip ("'biz'")); 35 | } 36 | 37 | public function testNewLines() { 38 | $this->assertEquals (array ('x' => "\n"), roundTrip ("\n")); 39 | } 40 | 41 | public function testHashes() { 42 | $this->assertEquals (array ('x' => array ("#color" => '#fff')), roundTrip (array ("#color" => '#fff'))); 43 | } 44 | 45 | public function testPreserveString() { 46 | $result1 = roundTrip ('0'); 47 | $result2 = roundTrip ('true'); 48 | $this->assertTrue (is_string ($result1['x'])); 49 | $this->assertTrue (is_string ($result2['x'])); 50 | } 51 | 52 | public function testPreserveBool() { 53 | $result = roundTrip (true); 54 | $this->assertTrue (is_bool ($result['x'])); 55 | } 56 | 57 | public function testPreserveInteger() { 58 | $result = roundTrip (0); 59 | $this->assertTrue (is_int ($result['x'])); 60 | } 61 | 62 | public function testWordWrap() { 63 | $this->assertEquals (array ('x' => "aaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"), roundTrip ("aaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb")); 64 | } 65 | 66 | public function testABCD() { 67 | $this->assertEquals (array ('a', 'b', 'c', 'd'), Spyc::YAMLLoad(Spyc::YAMLDump(array('a', 'b', 'c', 'd')))); 68 | } 69 | 70 | public function testABCD2() { 71 | $a = array('a', 'b', 'c', 'd'); // Create a simple list 72 | $b = Spyc::YAMLDump($a); // Dump the list as YAML 73 | $c = Spyc::YAMLLoad($b); // Load the dumped YAML 74 | $d = Spyc::YAMLDump($c); // Re-dump the data 75 | $this->assertSame($b, $d); 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /ThinkPHP/Library/Vendor/spyc/tests/comments.yaml: -------------------------------------------------------------------------------- 1 | foo: 'bar' #Comment 2 | arr: ['x', 'y', 'z'] # Comment here 3 | bar: kittens -------------------------------------------------------------------------------- /ThinkPHP/Library/Vendor/spyc/tests/failing1.yaml: -------------------------------------------------------------------------------- 1 | MyObject: 2 | Prop1: {key1:val1} -------------------------------------------------------------------------------- /ThinkPHP/Library/Vendor/spyc/tests/indent_1.yaml: -------------------------------------------------------------------------------- 1 | root: 2 | child_1: 2 3 | 4 | child_2: 0 5 | child_3: 1 6 | 7 | root2: 8 | child_1: 1 9 | # A comment 10 | child_2: 2 11 | 12 | displays: 13 | - resolutions: 14 | 1024: 768 15 | - resolutions: 16 | 1920: 1200 17 | 18 | display: 19 | - resolutions: 20 | 1024: 768 21 | 1920: 1200 22 | producer: "Nec" 23 | 24 | nested_hashes_and_seqs: 25 | - { row: 0, col: 0, headsets_affected: [{ports: [0], side: left}], switch_function: {ics_ptt: true} } 26 | 27 | easier_nest: { h: [{a: b, a1: b1}, {c: d}] } 28 | 29 | one_space: | 30 | By four 31 | spaces 32 | 33 | steps: 34 | - step: &id001 35 | instrument: Lasik 2000 36 | pulseEnergy: 5.4 37 | pulseDuration: 12 38 | repetition: 1000 39 | spotSize: 1mm 40 | - step: 41 | <<: *id001 42 | spotSize: 2mm 43 | 44 | death masks are: 45 | sad: 2 46 | <<: {magnificent: 4} 47 | 48 | login: &login 49 | adapter: mysql 50 | host: localhost 51 | 52 | development: 53 | database: rails_dev 54 | <<: *login 55 | 56 | "key": "value:" 57 | colon_only: ":" 58 | 59 | list_and_comment: [one, two, three] # comment 60 | kai: 61 | -example: value 62 | kai_list_of_items: 63 | - -item 64 | - '-item' 65 | -item -------------------------------------------------------------------------------- /ThinkPHP/Library/Vendor/spyc/tests/quotes.yaml: -------------------------------------------------------------------------------- 1 | html_tags: 2 | -
'; 20 | echo Spyc::YAMLDump($array); 21 | echo '
4 | html_content: 5 | -
hello world
6 | - hello:(
25 | 26 |FILE: LINE:
34 |ThinkPHP { Fast & Simple OOP PHP Framework } -- [ WE CAN DO IT JUST THINK ]
51 |